new AxMath()
- Source:
Methods
(static) Abs(x) → {Number}
Returns the absolute value of a given number
Parameters:
Name | Type | Description |
---|---|---|
x |
Number | The number whose absolute value to get |
- Source:
Returns:
Returns the absolute value of the given number
- Type
- Number
(static) ArcCos(x) → {Number}
Calculates the inverse cosine of a number
Parameters:
Name | Type | Description |
---|---|---|
x |
Number | The number in whose arccosine to calculate |
- Source:
Returns:
Returns the arccosine of the given number
- Type
- Number
(static) ArcCot(x) → {Number}
Calculates the inverse cotangent of a number
Parameters:
Name | Type | Description |
---|---|---|
x |
Number | The number in whose arccotangent to calculate |
- Source:
Returns:
Returns the arccotangent of the given number
- Type
- Number
(static) ArcSin(x) → {Number}
Calculates the inverse sine of a number
Parameters:
Name | Type | Description |
---|---|---|
x |
Number | The number in whose arcsine to calculate |
- Source:
Returns:
Returns the arcsine of the given number
- Type
- Number
(static) ArcTan(x) → {Number}
Calculates the inverse tangent of a number
Parameters:
Name | Type | Description |
---|---|---|
x |
Number | The number in whose arctangent to calculate |
- Source:
Returns:
Returns the arctangent of the given number
- Type
- Number
(static) ArcTan2(x, y) → {Number}
Calculates the inverse of the tangent, obtained by two cartesian coordinates
Produces a the quadrant-correct angle between the positive x-axis and the vector with the given coordinates
Parameters:
Name | Type | Description |
---|---|---|
x |
Number | The X coordinate of the vector whose angle to calculate |
y |
Number | The Y coordinate of the vector whose angle to calculate |
- Source:
Returns:
Returns the arctangent of the vector with the given coordinates
- Type
- Number
(static) Ceil(a) → {Number}
Returns the nearest integer value which is not less than the argument
Parameters:
Name | Type | Description |
---|---|---|
a |
Number | The argument for which to get integer for |
- Source:
Returns:
The nearest integral value which is not less than the argument
- Type
- Number
(static) Cos(x) → {Number}
Calculates the cosine of a number
Parameters:
Name | Type | Description |
---|---|---|
x |
Number | The number in radians whose cosine to calculate |
- Source:
Returns:
Returns the cosine of the given number
- Type
- Number
(static) Cot(x) → {Number}
Calculates the cotangent of a number
Parameters:
Name | Type | Description |
---|---|---|
x |
Number | The number in radians whose cotangent to calculate |
- Source:
Returns:
Returns the cotangent of the given number
- Type
- Number
(static) CRC32(source, size, seed) → {Number}
Calculates the CRC sum for a given source, based on a CRC table and a seed
Parameters:
Name | Type | Description |
---|---|---|
source |
Number | The source for which to calculate a CRC sum |
size |
Number | Size of the source in bytes |
seed |
Number | The initial seed for calculating the CRC sum |
- Source:
Returns:
Returns a CRC sum for the given source
- Type
- Number
(static) CRC32GenerateTable(crcPolynomial)
Generates the table used to calculate CRC sums.
Parameters:
Name | Type | Description |
---|---|---|
crcPolynomial |
Number | The the polynomial used for generating the table |
- Source:
(static) Exp(exponent) → {Number}
Calculates the natural exponent, that is the Euler's number, e, to the power of a given exponent
Parameters:
Name | Type | Description |
---|---|---|
exponent |
Number | The power to which e will be raised |
- Source:
Returns:
The natural exponent of the given value
- Type
- Number
(static) Floor(a) → {Number}
Returns the nearest integer value which is not greater than the argument
Parameters:
Name | Type | Description |
---|---|---|
a |
Number | The argument for which to get integer for |
- Source:
Returns:
The nearest integral value which is not greater than the argument
- Type
- Number
(static) High(value) → {Number}
Returns a value of the high 16 bits of a given number
Parameters:
Name | Type | Description |
---|---|---|
value |
Number | The value to get the high 16 bits from |
- Source:
Returns:
The high 16 bits of the given number
- Type
- Number
(static) HighLow(high, low) → {Number}
Returns a value whose high and low 16 bit parts are constructed by the low 16 bits of two given values
Parameters:
Name | Type | Description |
---|---|---|
high |
Number | The value from which to form the high 16 bit part of the result |
low |
Number | The value from which to form the low 16 bit part of the result |
- Source:
Returns:
A number whose high and low 16 bit parts are constructed by the low 16 bits of two given values
- Type
- Number
(static) InvSqrt(x) → {Number}
Calculates the inverse square root of a number, i.e. 1 / Sqrt(x)
Parameters:
Name | Type | Description |
---|---|---|
x |
Number | The number whose inverse square root to calculate |
- Source:
Returns:
Returns the inverse square root of the given number
- Type
- Number
(static) Lg(x) → {Number}
Calculates the common logarithm of x, that is, the logarithm of x to base 10
Parameters:
Name | Type | Description |
---|---|---|
x |
Number | The argument of the logarithm |
- Source:
Returns:
The common logarithm of x
- Type
- Number
(static) Ln(x) → {Number}
Calculates the natural logarithm of x, that is, the logarithm of x to the Euler number, e
Parameters:
Name | Type | Description |
---|---|---|
x |
Number | The argument of the logarithm |
- Source:
Returns:
The natural logarithm of x
- Type
- Number
(static) Log(base, x) → {Number}
Calculates the logarithm of x to a given base
Parameters:
Name | Type | Description |
---|---|---|
base |
Number | The base of the logarithm |
x |
Number | The argument of the logarithm |
- Source:
Returns:
The logarithm of x to the given base
- Type
- Number
(static) Low(value) → {Number}
Returns a value of the low 16 bits of a given number
Parameters:
Name | Type | Description |
---|---|---|
value |
Number | The value to get the low 16 bits from |
- Source:
Returns:
The low 16 bits of the given number
- Type
- Number
(static) Max(a, b) → {Number}
Returns the greater of two values
Parameters:
Name | Type | Description |
---|---|---|
a |
Number | A value to compare against |
b |
Number | A value to compare against |
- Source:
Returns:
The greater of the two given values
- Type
- Number
(static) Min(a, b) → {Number}
Returns the lesser of two values
Parameters:
Name | Type | Description |
---|---|---|
a |
Number | A value to compare against |
b |
Number | A value to compare against |
- Source:
Returns:
The lesser of the two given values
- Type
- Number
(static) Power(base, exponent) → {Number}
Raises a number to a given exponent
Parameters:
Name | Type | Description |
---|---|---|
base |
Number | The base which to raise |
exponent |
Number | The power to which the base will be raised |
- Source:
Returns:
Retrns the base raised to the given exponent
- Type
- Number
(static) Random() → {Number}
Produces a random floating point number between zero (including) and 1 (excluding), i.e. in [0, 1)
- Source:
Returns:
Returns a random number between (and including) zero and 1 (excluding)
- Type
- Number
(static) RandomInt(n) → {Number}
Produces a random integer number ranging from zero (including) to a given limit (excluding), i.e. in [0, n)
Parameters:
Name | Type | Description |
---|---|---|
n |
Number | The maximum limit, between zero and which to generate the random number. The result can not include the limit itself |
- Source:
Returns:
Returns a random number between (and including) zero and the given limit (excluding)
- Type
- Number
(static) Round(x) → {Number}
Rounds a value to an integer number
Parameters:
Name | Type | Description |
---|---|---|
x |
Number | The number which to round |
- Source:
Returns:
Returns an integer rounded value of the given number
- Type
- Number
(static) Sign(x) → {Number}
Returns the sign value of a given number
Parameters:
Name | Type | Description |
---|---|---|
x |
Number | The number whose sign to get |
- Source:
Returns:
Returns 1 if the number is positive, -1 if negative and 0 if it's zero
- Type
- Number
(static) Sin(x) → {Number}
Calculates the sine of a number
Parameters:
Name | Type | Description |
---|---|---|
x |
Number | The number in radians whose sine to calculate |
- Source:
Returns:
Returns the sine of the given number
- Type
- Number
(static) Sqrt(x) → {Number}
Calculates the square root of a number
Parameters:
Name | Type | Description |
---|---|---|
x |
Number | The radicant number whose squre root to calculate |
- Source:
Returns:
Returns the square root of the given number
- Type
- Number
(static) Tan(x) → {Number}
Calculates the tangent of a number
Parameters:
Name | Type | Description |
---|---|---|
x |
Number | The number in radians whose tangent to calculate |
- Source:
Returns:
Returns the tangent of the given number
- Type
- Number
(static) Trim(x, min, max) → {Number}
Returns a number limited by a minimum and a maximum boundaries
Parameters:
Name | Type | Description |
---|---|---|
x |
Number | The number to trim |
min |
Number | Minmimum boundary to trim against |
max |
Number | Maximum boundary to trim agains |
- Source:
Returns:
The number, trimmed if necessary, by the given boundaries
- Type
- Number
(static) Trunc(a) → {Number}
Returns the truncated integer part of the given argument
Parameters:
Name | Type | Description |
---|---|---|
a |
Number | The argument for which to get truncated value for |
- Source:
Returns:
The truncated integer part of the argument
- Type
- Number