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.
Returns
number
: The absolute value of the input.
Math.Abs(1)
// Result:
// 1
Math.Abs(-1)
// Result:
// 1
Math.Abs(0.0)
// Result:
// 0.0
Math.Abs(-1.2)
// Result:
// 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.
Returns
double
: The angle in radians.
Math.Acos(0)
// Result:
// 1.57079632679
Math.Acos(1)
// Result:
// 0.0
Math.Acos(0.5)
// Result:
// 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.
Returns
double
: The angle in radians.
Math.Asin(0)
// Result:
// 0.0
Math.Asin(1)
// Result:
// 1.57079632679
Math.Asin(0.5)
// Result:
// 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.
Returns
double
: The angle in radians.
Math.Atan(0)
// Result:
// 0.0
Math.Atan(1)
// Result:
// 0.78539816339
Math.Atan(-1)
// Result:
// -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.
Returns
double
: The angle in radians.
Math.Atn2(1, 0)
// Result:
// 1.57079632679
Math.Atn2(0, 1)
// Result:
// 0.0
Math.Atn2(1, 1)
// Result:
// 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.
Returns
long
: The smallest integer greater or equal to the specified value.
Math.Ceiling(1.1)
// Result:
// 2
Math.Ceiling(1.0)
// Result:
// 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.
Returns
double
: The cosine of the specified value.
Math.Cos(0.0)
// Result:
// 1.0
Math.Cos(Math.Pi()/3)
// Result:
// 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.
Returns
double
: The cotangent of the specified value.
Math.Cot(Math.Pi()/4)
// Result:
// 1.0
Math.Cot(Math.Pi()/2)
// Result:
// 0.0
Degrees
Converts an angle from radians to degrees.
Math.Degrees(value: double)
Parameters
value
: The angle in radians to convert to degrees.
Returns
double
: The angle in degrees.
Math.Degrees(Math.Pi()) // 180.0
// Result:
// 180.0
Math.Degrees(Math.Pi()/3) // 60.0
// Result:
// 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.
Returns
double
: The exponential of the specified value.
Math.Exp(0.0)
// Result:
// 1.0
Math.Exp(1)
// Result:
// 2.71828182845905
Floor
Returns the largest integer not greater than the value.
Math.Floor(value: decimal)
Parameters
value
: The value to be floored.
Returns
long
: The largest integer not greater than the value.
Math.Floor(1.1)
// Result:
// 1.0
Math.Floor(2.7)
// Result:
// 2.0
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.