Math

Description

A global object containing a set of math functions and constants.

Static Properties

E readonly Euler’s constant and the base of natural logarithms.
LN10 readonly The natural logarithm of 10.
LN2 readonly The natural logarithm of 2.
LOG10E readonly The base 10 logarithm of e.
LOG2E readonly The base 2 logarithm of e.
PI readonly The ratio of the circumference of a circle to its diameter.
SQRT1_2 readonly The reciprocal of the square root of 1/2.
SQRT2 readonly The square root of 2.

Static Methods

abs readonly Returns the absolute value of a number.
acos readonly Returns the arc cosine(in radians) of a number.
asin readonly Returns the arc sin(in radians) of a number.
atan readonly Returns the arc tangent(in radians) of a number.
atan2 readonly Returns the arc tangent of the quotient of its arguments (y/x).
ceil readonly Rounds the number up to the nearest integer.
cos readonly Returns the cosine of an angle provided in radians.
exp readonly Returns Math.E raised to the power of a number.
floor readonly Rounds a number down to the nearest integer.
log readonly Returns the natural logarithm of a number.
max readonly Returns the largest of zero or more numbers.
min readonly Returns the smallest of zero or more numbers.
pow readonly Returns x raised to the power of y.
random readonly Returns a pseudo-random number from 0.0 up to but not including 1.0.
round readonly Rounds a number to the nearest integer.
sin readonly Returns the sine of an angle provided in radians.
sqrt readonly Returns the square root of a number.
tan readonly Returns the tangent of an angle provided in radians.