Math
Library of mathematical functions.
Functions
Abs
Returns the absolute value by discarding sign of a numeric expression. Results are greater or equal to 0.
Math.Abs(value: number)
Parameters
value
: The value on which the absolute value is computed.
Abs(1) // 1
Abs(-1) // 1
Abs(0.0) // 0.0
Abs(-1.2) // 1.2
Acos
Arcosine, returns the angle in radians which cosine is specified by the value.
Math.Acos(value: double)
Parameters
value
: The value on which the Acos arcosine is computed.
Acos(0) // Pi/2 ~= 1.57079632679
Acos(1) // 0.0
Acos(0.5) // Pi/3 ~= 1.0471975512
Asin
Arcsine, returns the angle in radians which sine is specified by the value.
Math.Asin(value: double)
Parameters
value
: The value on which the arcsine is computed.
Asin(0) // 0.0
Asin(1) // Pi/2 ~= 1.57079632679
Asin(0.5) // Pi/6 ~= 0.52359877559
Atan
Arctangent, returns the angle in radians which tangent is specified by the value.
Math.Atan(value: double)
Parameters
value
: The value on which the arctangent is compute.
Atan(0) // 0.0
Atan(1) // Pi/4 ~= 0.78539816339
Atan(-1) // -Pi/4 ~= -0.78539816339
Atn2
Returns the angle in radians of the vector (x, y).
Math.Atn2(x: number, y: number)
Parameters
x
: The x coordinate of the vector.
y
: The y coordinate of the vector.
Atn2(1, 0) // Pi/2 ~= 1.57079632679
Atn2(0, 1) // 0.0
Atn2(1, 1) // Pi/4 ~= 0.78539816339
Ceiling
Returns the smallest integer greater or equal to the specified value.
Math.Ceiling(value: number)
Parameters
value
: The value on which the ceiling is computed.
Ceiling(1.1) // 2
Ceiling(1.0) // 1
Cos
Returns the cosine specified by the value in radians.
Math.Cos(value: double)
Parameters
value
: The value on which the cosine is computed.
Cos(0.0) // 1.0
Cos(Pi()/3)// 0.5
Cot
Returns the cotangent specified by the value in radians.
Math.Cot(value: double)
Parameters
value
: The value on which the cotangent is computed.
Cot(Pi()/4) // 1.0
Cot(Pi()/2)// 0.0
Degrees
Converts an angle from radians to degrees.
Math.Degrees(value: double)
Parameters
value
: The angle in radians to convert to degrees.
Degrees(Pi()) // 180.0
Degrees(Pi()/3) // 60.0
Exp
Return the exponential of the specified value.
Math.Exp(value: double)
Parameters
value
: The value on which the exponential function is applied.
Exp(0.0) // 1.0
Exp(1) // ~= 2.71828182845905 (Euler's number)
Floor
Returns the largest integer not greater than the value.
Math.Floor(value: decimal)
Parameters
value
: The value to be floored.
Floor(1.1) // 1
Floor(2.7) // 2
Log
Returns the logarithm base e specified by the value.
Math.Log(value: double)
Parameters
value
: The value on which logarithm base e is applied.
Log(1) // 0.0
Log(2.71828182845905) // ~= 1.0
Log10
Returns the logarithm base 10 specified by the value.
Math.Log10(value: double)
Parameters
value
: The value on which the logarithm base 10 is applied.
Log10(1) // 0.0
Log10(10) // 1.0
Pi
Pi mathematical constant (3.14159...)
Math.Pi()
Power
Returns the first value to the power of the second value.
Math.Power(base: double, exponent: double)
Parameters
base
: The base.
exponent
: The exponent.
Power(2, 3) // 8
Power(4, 0.5) // 2
Radians
Converts an angle from degrees to radians.
Math.Radians(value: double)
Parameters
value
: The angle in degrees to convert to radians.
Radians(180) // Pi ~= 3.141592653589793
Radians(60.0) // Pi/3 ~= 1.0471975512
Random
Pseudo random number generator, returns a double between 0.0 and 1.0.
Math.Random()
Sign
Returns the sign, 1, -1 or 0 for the specified value.
Math.Sign(value: number)
Parameters
value
: The value on which the sign is computed.
Sign(2) // 1
Sign(-2) // -1
Sign(0) // 0
Sin
Returns the sine specified by the value in radians.
Math.Sin(value: double)
Parameters
value
: The value on which the sine is computed.
Sin(0.0) // 0.0
Sin(Pi()/6)// 0.5
Sqrt
Returns the square root of the specified value.
Math.Sqrt(value: double)
Parameters
value
: The value on which the square root is computed.
SQRT(4) // 2
SQRT(2) // 1.41421356237
Square
Returns the square value.
Math.Square(value: double)
Parameters
value
: The value to be squared.
Square(2) // 4.0
Square(3) // 9.0
Tan
Returns the tangent specified by the value in radians.
Math.Tan(value: double)
Parameters
value
: The value on which the tangent is computed.
Tan(0.0) // 0.0
Tan(Pi()/4) // 1.0