Skip to content

Latest commit

 

History

History
74 lines (61 loc) · 1.9 KB

README.md

File metadata and controls

74 lines (61 loc) · 1.9 KB

Calculus

Build Status Coverage Status Code Climate Issue Count Total Downloads Latest Stable Version Version

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();