zazalt / calculus
Calculus
dev-master
2017-02-23 13:44 UTC
Requires
- php: >=7.1.0
This package is not auto-updated.
Last update: 2025-01-04 21:41:41 UTC
README
Calculus is a PHP library for mathematics/2D/3D computing
Requirements
- php >= 7.1.0
Packagist Dependencies
- None
Installation
With composer:
{ "require": { "zazalt/calculus": "dev-master" } }
Usage
$Calculus = new Zazalt\Calculus\Calculus(); /** * Check if a nunmber is prime based on trial division * * @return boolean */ $Calculus->isPrimeNumber($number); /** * Calculating distance between two points on a flat plane * * @return integer */ $Calculus->distanceBetweenTwoPoints($pointA = [], $pointB = []); /** * Resize a rectangle object until it falls in desired dimension, but keep aspect ratio * A usefull function/method when want to resize an image * * @return array */ $Calculus->resizeRectangle($rectangleDimensions = [], $rectangleNewDimensions = []); /** * Not implemented/documented, yet! */ $Calculus->mean(); /** * Not implemented/documented, yet! */ $Calculus->median(); /** * Not implemented/documented, yet! */ $Calculus->mode();