The $Math namespace houses mathematical constants and functions that may be useful when writing scripts.
Note:
There are additional mathematical functions available in DeltaScript that are included as part of the standard library
.
$Math.PIPi
represented as a float.
Note:
The float type in DeltaScript is actually implemented as a double-precision floating point number
, and is internally mapped to Java's double primitive type.
Read more:
$Math.cos(float rad) -> floatReturns the cosine of an angle (expressed in radians) rad.
Wraps Java's Math.cos(double)
function
$Math.sin(float rad) -> floatReturns the sine of an angle (expressed in radians) rad.
Wraps Java's Math.sin(double)
function
$Math.tan(float rad) -> floatReturns the tangent of an angle (expressed in radians) rad.
Wraps Java's Math.tan(double)
function
$Math.acos(float ratio) -> floatReturns the arc cosine of ratio.
Wraps Java's Math.acos(double)
function
$Math.asin(float ratio) -> floatReturns the arc sine of ratio.
Wraps Java's Math.asin(double)
function
$Math.atan(float ratio) -> floatReturns the arc tangent of ratio.
Wraps Java's Math.atan(double)
function
$Math.sqrt(float n) -> floatReturns the square root of a value n.
Wraps Java's Math.sqrt(double)
function
$Math.round(float n) -> floatReturns the closest integer to n, expressed as a float.
$Math.floor(float n) -> floatReturns the largest integer less than or equal to n, expressed as a float.
Wraps Java's Math.floor(double)
function
$Math.ceil(float n) -> floatReturns the smallest integer greater than or equal to n, expressed as a float.
Wraps Java's Math.ceil(double)
function