A global object containing a set of math functions and constants.
Go to Property Listing | Method Listing
abs, acos, asin, atan, atan2, ceil, cos, exp, floor, log, max, min, pow, random, round, sin, sqrt, tan
Name |
Type |
Access |
Description |
---|---|---|---|
readonly |
Euler's constant and the base of natural logarithms. |
||
readonly |
The natural logarithm of 10. |
||
readonly |
The natural logarithm of 2. |
||
readonly |
The base 10 logarithm of e. |
||
readonly |
The base 2 logarithm of e. |
||
readonly |
The ratio of the circumference of a circle to its diameter. |
||
readonly |
The reciprocal of the square root of 1/2. |
||
readonly |
The square root of 2. |
Number abs (x:Number)
Returns the absolute value of a number.
Parameter |
Type |
Description |
---|---|---|
x |
A number. |
Number acos (x:Number)
Returns the arc cosine(in radians) of a number.
Parameter |
Type |
Description |
---|---|---|
x |
A number. |
Number asin (x:Number)
Returns the arc sin(in radians) of a number.
Parameter |
Type |
Description |
---|---|---|
x |
A number. |
Number atan (x:Number)
Returns the arc tangent(in radians) of a number.
Parameter |
Type |
Description |
---|---|---|
x |
A number. |
Number atan2 (y:Number, x:Number)
Returns the arc tangent of the quotient of its arguments (y/x).
Number ceil (x:Number)
Rounds the number up to the nearest integer.
Parameter |
Type |
Description |
---|---|---|
x |
A number. |
Number cos (x:Number)
Returns the cosine of an angle provided in radians.
Parameter |
Type |
Description |
---|---|---|
x |
An angle, in radians. |
Number exp (x:Number)
Returns Math.E raised to the power of a number.
Parameter |
Type |
Description |
---|---|---|
x |
A number. |
Number floor (x:Number)
Rounds a number down to the nearest integer.
Parameter |
Type |
Description |
---|---|---|
x |
A number. |
Number log (x:Number)
Returns the natural logarithm of a number.
Parameter |
Type |
Description |
---|---|---|
x |
A number. |
Number max (value1, value2, ...:Number)
Returns the largest of zero or more numbers.
Parameter |
Type |
Description |
---|---|---|
value1, value2, ... |
Numbers. |
Number min (value1, value2, ...:Number)
Returns the smallest of zero or more numbers.
Parameter |
Type |
Description |
---|---|---|
value1, value2, ... |
Numbers. |
Number pow (x:Number, y:Number)
Returns x raised to the power of y.
Number random ()
Returns a pseudo-random number from 0.0 up to but not including 1.0.
Number round (x:Number)
Rounds a number to the nearest integer.
Parameter |
Type |
Description |
---|---|---|
x |
A number. |
Number sin (x:Number)
Returns the sine of an angle provided in radians.
Parameter |
Type |
Description |
---|---|---|
x |
An angle, in radians. |
Number sqrt (x:Number)
Returns the square root of a number.
Parameter |
Type |
Description |
---|---|---|
x |
A number. |
Number tan (x:Number)
Returns the tangent of an angle provided in radians.
Parameter |
Type |
Description |
---|---|---|
x |
An angle, in radians. |