class MathTrig (View source)

Methods

static float
ATAN2(float $xCoordinate = null, float $yCoordinate = null)

ATAN2.

static float
CEILING(float $number, float $significance = null)

CEILING.

static int
COMBIN(int $numObjs, int $numInSet)

COMBIN.

static int
EVEN(float $number)

EVEN.

static int
FACT(float $factVal)

FACT.

static int
FACTDOUBLE(float $factVal)

FACTDOUBLE.

static float
FLOOR(float $number, float $significance = null)

FLOOR.

static int
GCD(mixed ...$args)

GCD.

static int
INT(float $number)

INT.

static int
LCM(mixed ...$args)

LCM.

static float
logBase(float $number = null, float $base = 10)

LOG_BASE.

static float
MDETERM(array $matrixValues)

MDETERM.

static array
MINVERSE(array $matrixValues)

MINVERSE.

static array
MMULT(array $matrixData1, array $matrixData2)

MMULT.

static int
MOD(int $a = 1, int $b = 1)

MOD.

static float
MROUND(float $number, int $multiple)

MROUND.

static float
MULTINOMIAL(array ...$args)

MULTINOMIAL.

static int
ODD(float $number)

ODD.

static float
POWER(float $x = 0, float $y = 2)

POWER.

static float
PRODUCT(mixed ...$args)

PRODUCT.

static float
QUOTIENT(mixed ...$args)

QUOTIENT.

static int
RAND(int $min = 0, int $max = 0)

RAND.

static 
ROMAN($aValue, $style = 0)

No description

static float
ROUNDUP(float $number, int $digits)

ROUNDUP.

static float
ROUNDDOWN(float $number, int $digits)

ROUNDDOWN.

static float
SERIESSUM(...$args)

SERIESSUM.

static int
SIGN(float $number)

SIGN.

static float
SQRTPI(float $number)

SQRTPI.

static 
filterHiddenArgs($cellReference, $args)

No description

static 
filterFormulaArgs($cellReference, $args)

No description

static float
SUBTOTAL(...$args)

SUBTOTAL.

static float
SUM(mixed ...$args)

SUM.

static float
SUMIF(mixed $aArgs, string $condition, mixed $sumArgs = [])

SUMIF.

static float
SUMIFS(...$args)

SUMIFS.

static float
SUMPRODUCT(mixed ...$args)

SUMPRODUCT.

static float
SUMSQ(mixed ...$args)

SUMSQ.

static float
SUMX2MY2(mixed[] $matrixData1, mixed[] $matrixData2)

SUMX2MY2.

static float
SUMX2PY2(mixed[] $matrixData1, mixed[] $matrixData2)

SUMX2PY2.

static float
SUMXMY2(mixed[] $matrixData1, mixed[] $matrixData2)

SUMXMY2.

static float
TRUNC(float $value = 0, int $digits = 0)

TRUNC.

static float|string
SEC(float $angle)

SEC.

static float|string
SECH(float $angle)

SECH.

static float|string
CSC(float $angle)

CSC.

static float|string
CSCH(float $angle)

CSCH.

static float|string
COT(float $angle)

COT.

static float|string
COTH(float $angle)

COTH.

static float|string
ACOT(float $number)

ACOT.

static float|string
ACOTH(float $number)

ACOTH.

Details

static float ATAN2(float $xCoordinate = null, float $yCoordinate = null)

ATAN2.

This function calculates the arc tangent of the two variables x and y. It is similar to calculating the arc tangent of y รท x, except that the signs of both arguments are used to determine the quadrant of the result. The arctangent is the angle from the x-axis to a line containing the origin (0, 0) and a point with coordinates (xCoordinate, yCoordinate). The angle is given in radians between -pi and pi, excluding -pi.

Note that the Excel ATAN2() function accepts its arguments in the reverse order to the standard PHP atan2() function, so we need to reverse them here before calling the PHP atan() function.

Excel Function: ATAN2(xCoordinate,yCoordinate)

Parameters

float $xCoordinate the x-coordinate of the point
float $yCoordinate the y-coordinate of the point

Return Value

float the inverse tangent of the specified x- and y-coordinates

static float CEILING(float $number, float $significance = null)

CEILING.

Returns number rounded up, away from zero, to the nearest multiple of significance. For example, if you want to avoid using pennies in your prices and your product is priced at $4.42, use the formula =CEILING(4.42,0.05) to round prices up to the nearest nickel.

Excel Function: CEILING(number[,significance])

Parameters

float $number the number you want to round
float $significance the multiple to which you want to round

Return Value

float Rounded Number

static int COMBIN(int $numObjs, int $numInSet)

COMBIN.

Returns the number of combinations for a given number of items. Use COMBIN to determine the total possible number of groups for a given number of items.

Excel Function: COMBIN(numObjs,numInSet)

Parameters

int $numObjs Number of different objects
int $numInSet Number of objects in each combination

Return Value

int Number of combinations

static int EVEN(float $number)

EVEN.

Returns number rounded up to the nearest even integer. You can use this function for processing items that come in twos. For example, a packing crate accepts rows of one or two items. The crate is full when the number of items, rounded up to the nearest two, matches the crate's capacity.

Excel Function: EVEN(number)

Parameters

float $number Number to round

Return Value

int Rounded Number

static int FACT(float $factVal)

FACT.

Returns the factorial of a number. The factorial of a number is equal to 123... number.

Excel Function: FACT(factVal)

Parameters

float $factVal Factorial Value

Return Value

int Factorial

static int FACTDOUBLE(float $factVal)

FACTDOUBLE.

Returns the double factorial of a number.

Excel Function: FACTDOUBLE(factVal)

Parameters

float $factVal Factorial Value

Return Value

int Double Factorial

static float FLOOR(float $number, float $significance = null)

FLOOR.

Rounds number down, toward zero, to the nearest multiple of significance.

Excel Function: FLOOR(number[,significance])

Parameters

float $number Number to round
float $significance Significance

Return Value

float Rounded Number

static int GCD(mixed ...$args)

GCD.

Returns the greatest common divisor of a series of numbers. The greatest common divisor is the largest integer that divides both number1 and number2 without a remainder.

Excel Function: GCD(number1[,number2[, ...]])

Parameters

mixed ...$args Data values

Return Value

int Greatest Common Divisor

static int INT(float $number)

INT.

Casts a floating point value to an integer

Excel Function: INT(number)

Parameters

float $number Number to cast to an integer

Return Value

int Integer value

static int LCM(mixed ...$args)

LCM.

Returns the lowest common multiplier of a series of numbers The least common multiple is the smallest positive integer that is a multiple of all integer arguments number1, number2, and so on. Use LCM to add fractions with different denominators.

Excel Function: LCM(number1[,number2[, ...]])

Parameters

mixed ...$args Data values

Return Value

int Lowest Common Multiplier

static float logBase(float $number = null, float $base = 10)

LOG_BASE.

Returns the logarithm of a number to a specified base. The default base is 10.

Excel Function: LOG(number[,base])

Parameters

float $number The positive real number for which you want the logarithm
float $base The base of the logarithm. If base is omitted, it is assumed to be 10.

Return Value

float

static float MDETERM(array $matrixValues)

MDETERM.

Returns the matrix determinant of an array.

Excel Function: MDETERM(array)

Parameters

array $matrixValues A matrix of values

Return Value

float

static array MINVERSE(array $matrixValues)

MINVERSE.

Returns the inverse matrix for the matrix stored in an array.

Excel Function: MINVERSE(array)

Parameters

array $matrixValues A matrix of values

Return Value

array

static array MMULT(array $matrixData1, array $matrixData2)

MMULT.

Parameters

array $matrixData1 A matrix of values
array $matrixData2 A matrix of values

Return Value

array

static int MOD(int $a = 1, int $b = 1)

MOD.

Parameters

int $a Dividend
int $b Divisor

Return Value

int Remainder

static float MROUND(float $number, int $multiple)

MROUND.

Rounds a number to the nearest multiple of a specified value

Parameters

float $number Number to round
int $multiple Multiple to which you want to round $number

Return Value

float Rounded Number

static float MULTINOMIAL(array ...$args)

MULTINOMIAL.

Returns the ratio of the factorial of a sum of values to the product of factorials.

Parameters

array ...$args of mixed Data Series

Return Value

float

static int ODD(float $number)

ODD.

Returns number rounded up to the nearest odd integer.

Parameters

float $number Number to round

Return Value

int Rounded Number

static float POWER(float $x = 0, float $y = 2)

POWER.

Computes x raised to the power y.

Parameters

float $x
float $y

Return Value

float

static float PRODUCT(mixed ...$args)

PRODUCT.

PRODUCT returns the product of all the values and cells referenced in the argument list.

Excel Function: PRODUCT(value1[,value2[, ...]])

Parameters

mixed ...$args Data values

Return Value

float

static float QUOTIENT(mixed ...$args)

QUOTIENT.

QUOTIENT function returns the integer portion of a division. Numerator is the divided number and denominator is the divisor.

Excel Function: QUOTIENT(value1[,value2[, ...]])

Parameters

mixed ...$args Data values

Return Value

float

static int RAND(int $min = 0, int $max = 0)

RAND.

Parameters

int $min Minimal value
int $max Maximal value

Return Value

int Random number

static ROMAN($aValue, $style = 0)

Parameters

$aValue
$style

static float ROUNDUP(float $number, int $digits)

ROUNDUP.

Rounds a number up to a specified number of decimal places

Parameters

float $number Number to round
int $digits Number of digits to which you want to round $number

Return Value

float Rounded Number

static float ROUNDDOWN(float $number, int $digits)

ROUNDDOWN.

Rounds a number down to a specified number of decimal places

Parameters

float $number Number to round
int $digits Number of digits to which you want to round $number

Return Value

float Rounded Number

static float SERIESSUM(...$args)

SERIESSUM.

Returns the sum of a power series

Parameters

...$args

Return Value

float

static int SIGN(float $number)

SIGN.

Determines the sign of a number. Returns 1 if the number is positive, zero (0) if the number is 0, and -1 if the number is negative.

Parameters

float $number Number to round

Return Value

int sign value

static float SQRTPI(float $number)

SQRTPI.

Returns the square root of (number * pi).

Parameters

float $number Number

Return Value

float Square Root of Number * Pi

static protected filterHiddenArgs($cellReference, $args)

Parameters

$cellReference
$args

static protected filterFormulaArgs($cellReference, $args)

Parameters

$cellReference
$args

static float SUBTOTAL(...$args)

SUBTOTAL.

Returns a subtotal in a list or database.

Parameters

...$args

Return Value

float

static float SUM(mixed ...$args)

SUM.

SUM computes the sum of all the values and cells referenced in the argument list.

Excel Function: SUM(value1[,value2[, ...]])

Parameters

mixed ...$args Data values

Return Value

float

static float SUMIF(mixed $aArgs, string $condition, mixed $sumArgs = [])

SUMIF.

Counts the number of cells that contain numbers within the list of arguments

Excel Function: SUMIF(value1[,value2[, ...]],condition)

Parameters

mixed $aArgs Data values
string $condition the criteria that defines which cells will be summed
mixed $sumArgs

Return Value

float

static float SUMIFS(...$args)

SUMIFS.

Counts the number of cells that contain numbers within the list of arguments

Excel Function: SUMIFS(value1[,value2[, ...]],condition)

Parameters

...$args

Return Value

float

static float SUMPRODUCT(mixed ...$args)

SUMPRODUCT.

Excel Function: SUMPRODUCT(value1[,value2[, ...]])

Parameters

mixed ...$args Data values

Return Value

float

static float SUMSQ(mixed ...$args)

SUMSQ.

SUMSQ returns the sum of the squares of the arguments

Excel Function: SUMSQ(value1[,value2[, ...]])

Parameters

mixed ...$args Data values

Return Value

float

static float SUMX2MY2(mixed[] $matrixData1, mixed[] $matrixData2)

SUMX2MY2.

Parameters

mixed[] $matrixData1 Matrix #1
mixed[] $matrixData2 Matrix #2

Return Value

float

static float SUMX2PY2(mixed[] $matrixData1, mixed[] $matrixData2)

SUMX2PY2.

Parameters

mixed[] $matrixData1 Matrix #1
mixed[] $matrixData2 Matrix #2

Return Value

float

static float SUMXMY2(mixed[] $matrixData1, mixed[] $matrixData2)

SUMXMY2.

Parameters

mixed[] $matrixData1 Matrix #1
mixed[] $matrixData2 Matrix #2

Return Value

float

static float TRUNC(float $value = 0, int $digits = 0)

TRUNC.

Truncates value to the number of fractional digits by number_digits.

Parameters

float $value
int $digits

Return Value

float Truncated value

static float|string SEC(float $angle)

SEC.

Returns the secant of an angle.

Parameters

float $angle Number

Return Value

float|string The secant of the angle

static float|string SECH(float $angle)

SECH.

Returns the hyperbolic secant of an angle.

Parameters

float $angle Number

Return Value

float|string The hyperbolic secant of the angle

static float|string CSC(float $angle)

CSC.

Returns the cosecant of an angle.

Parameters

float $angle Number

Return Value

float|string The cosecant of the angle

static float|string CSCH(float $angle)

CSCH.

Returns the hyperbolic cosecant of an angle.

Parameters

float $angle Number

Return Value

float|string The hyperbolic cosecant of the angle

static float|string COT(float $angle)

COT.

Returns the cotangent of an angle.

Parameters

float $angle Number

Return Value

float|string The cotangent of the angle

static float|string COTH(float $angle)

COTH.

Returns the hyperbolic cotangent of an angle.

Parameters

float $angle Number

Return Value

float|string The hyperbolic cotangent of the angle

static float|string ACOT(float $number)

ACOT.

Returns the arccotangent of a number.

Parameters

float $number Number

Return Value

float|string The arccotangent of the number

static float|string ACOTH(float $number)

ACOTH.

Returns the hyperbolic arccotangent of a number.

Parameters

float $number Number

Return Value

float|string The hyperbolic arccotangent of the number