Download the PHP package fyre/math without Composer
On this page you can find all versions of the php package fyre/math. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package math
FyreMath
FyreMath is a free, open-source math library for PHP.
Table Of Contents
- Installation
- Methods
Installation
Using Composer
In PHP:
Methods
Abs
Get the absolute value of a number.
$number
is the input number.
Acos
Get the arc cosine of a number.
$number
is the input number.
Acosh
Get the inverse hyperbolic cosine of a number.
$number
is the input number.
Asin
Get the arc sine of a number.
$number
is the input number.
Asinh
Get the inverse hyperbolic sine of a number.
$number
is the input number.
Atan
Get the arc tangent of a number.
$number
is the input number.
Atan2
Get the arc tangent of 2 numbers.
$x
is a number representing the dividend.$y
is a number representing the divisor.
Atanh
Get the inverse hyperbolic tangent of a number.
$number
is the input number.
Binary To Decimal
Convert a binary number to decimal.
$binaryString
is the binary string.
Ceil
Round a number up.
$number
is the input number.
Clamp
Clamp a number between a min and max.
$number
is the input number.$min
is a number representing the minimum of the clamped value, and will default to 0.$max
is a number representing the maximum of the clamped value, and will default to 1.
Clamp Percent
Clamp a number between 0 and 100.
$number
is the input number.
Convert Base
Convert a number between bases.
$number
is the input number.$fromBase
is a number representing the base of the number.$toBase
is a number representing the base to convert to.
Cos
Get the cosine of a number.
$number
is the input number.
Cosh
Get the hyperbolic cosine of a number.
$number
is the input number.
Decimal To Binary
Convert a decimal number to binary.
$number
is the input number.
Decimal To Hex
Convert a decimal number to hex.
$number
is the input number.
Decimal To Octal
Convert a decimal number to octal.
$number
is the input number.
Degrees To Radians
Convert a number of degrees to radians.
$number
is the input number.
Distance
Calculate the distance between 2 points.
$x1
is a number representing the first X co-ordinate.$y1
is a number representing the first Y co-ordinate.$x2
is a number representing the second X co-ordinate.$y2
is a number representing the second Y co-ordinate.
Exp
Calculate the exponent of e
.
$number
is the input number.
Exp Minus 1
Calculate the exponent of e-1
.
$number
is the input number.
Floor
Round a number down.
$number
is the input number.
Fmod
Calculate the modulo of a number with a divisor.
$number
is the input number.$divisor
is a number representing the divisor.
Hex To Decimal
Convert a hex number to decimal.
$hexString
is the hex string.
Hypot
Calculate the length of a point.
$x
is a number representing the X co-ordinate.$y
is a number representing the Y co-ordinate.
Inverse Linear Interpolation
Inverse linear interpolation from one value to another.
$v1
is a number representing the minimum of the range.$v2
is a number representing the maximum of the range.$value
is a number representing the value to inverse interpolate.
Is Numeric
Determine if the value is numeric.
$value
is the value to test.
Linear Interpolation
Linear interpolation from one value to another.
$v1
is a number representing the minimum of the range.$v2
is a number representing the maximum of the range.$amount
is a number representing the amount to interpolate.
Log
Calculate the logarithm.
$number
is the input number.$base
is a number representing the logarithmic base, and will default to E.
Log 10
Calculate the base-10 logarithm.
$number
is the input number.
Log Plus 1
Calculate the logarithm of a number + 1.
$number
is the input number.
Map
Map a value from one range to another.
$number
is the input number.$fromMin
is a number representing the minimum value of the current range.$fromMax
is a number representing the maximum value of the current range.$toMin
is a number representing the minimum value of the target range.$toMax
is a number representing the maximum value of the target range.
Max
Find the highest value.
All arguments supplied to this method will be compared.
Min
Find the lowest value.
All arguments supplied to this method will be compared.
Octal To Decimal
Convert an octal number to decimal.
$octalString
is the octal string.
Pow
Raise a number to the power of exponent.
$number
is the input number.$exponent
is a number representing the exponent.
Product
Calculate the product of values.
All arguments supplied to this method will be multiplied.
Radians To Degrees
Convert a number of radians to degrees.
$number
is the input number.
Random
Return a random floating-point number.
$a
is a number representing the minimum value (inclusive).$b
is a number representing the maximum value (exclusive).
If $b
is omitted, this function will return a random number between 0 (inclusive) and $a
(exclusive).
If both arguments are omitted, this function will return a random number between 0 (inclusive) and 1 (exclusive).
Random Int
Return a random integer.
$a
is a number representing the minimum value (inclusive).$b
is a number representing the maximum value (exclusive).
If $b
is omitted, this function will return a random number between 0 (inclusive) and $a
(exclusive).
Round
Round a number.
$number
is the input number.$precision
is a number representing the number of decimal digits to use, and will default to 0.$mode
is a number representing the rounding mode to use, and will default to Math::ROUND_HALF_UP.
Sin
Get the sine of a number.
$number
is the input number.
Sinh
Get the hyperbolic sine of a number.
$number
is the input number.
Sqrt
Get the square root of a number.
$number
is the input number.
Sum
Calculate the sum of values.
All arguments supplied to this method will be added.
Tan
Get the tangent of a number.
$number
is the input number.
Tanh
Get the hyperbolic tangent of a number.
$number
is the input number.
To Step
Round a number to a specified step-size.
$number
is the input number.$step
is a number representing the minimum step-size, and will default to 0.01.