List of operators, constants, functions and their syntax. (Note! all are case sensitive)

Operators


+

Addition



Subtraction

*

Multiplication

/

Division

Constants


Math.E

Returns (E) Euler's constant. (2.718281828459045)

Math.LN10

Returns the natural logarithm of 10 (2.302585092994046).

Math.LN2

Returns the natural logarithm of 2 (0.6931471805599453)

Math.LOG10E

Returns the base 10 logarithm of E (0.4342944819032518)

Math.LOG2E

Returns the base 2 logarithm of 2 (1.4426950408889633).

Math.PI

Returns the numeric value of pi (3.141592653589793)

Math.SQRT1_2

Returns the square root of 1/2. (0.7071067811865476)

Math.SQRT2

Returns the square root of 2 (1.4142135623730951).

Functions

Functions return values based on the variables (in brackets) passed to them.

Math.pow(num1, num2)

Returns the number expressed to a power. "num1"^{"num2"}

Math.abs(num1)

Returns the absolute value of "num1".

Math.acos(num1)

Returns the arc cosine of "num1" in radians.

Math.asin(num1)

Returns the arc sine of "num1" in radians.

Math.atan(num1)

Returns the arc tangent of "num1" in radians.

Math.atan2(numX,numY,)

Returns the angle of the polar coordinate corresponding to ("numX","numY").

Math.ceil(num1)

Returns the least integer that is greater than or equal to "num1".

Math.cos(num1)

Returns the cosine of "num1" in radians

Math.exp(num1)

Returns the exponential value of "num1".

Math.floor(num1)

Returns the integer component of "num1".

Math.log(num1)

Returns the natural logarithm of "num1";

Math.max(num1,num2)

Returns the maximum of "num1" and "num2".

Math.min(num1,num2)

Returns the minimum of "num1" and "num2"

Math.random(num1)

Returns a random number up to the value of "num1".

Math.round(num1)

Returns "num1" rounded to the nearest integer.

Math.sin(num1)

Returns the sine of "num1" in radians.

Math.sqrt(num1)

Returns the square root of "num1".

Math.tan(num1)

Returns the tangent of "num1" in radians.
