Math (Object)
|
Top Previous Next |
Function
|
Requires Advanced Math Support?
|
Description
|
Math.abs(number)
|
N
|
Absolute value of number
|
Math.acos(number)
|
Y
|
Arc cos of ratio in radians
|
Math.acosdeg(number)
|
Y
|
Arc cos of ratio in degrees
|
Math.approach(number,dest,factor)
|
N
|
Moves 'value' closer to 'dest' by a factor of 'factor'
|
Math.asin(number)
|
Y
|
Arc sin of ratio in radians
|
Math.asindeg(number)
|
Y
|
Arc sin of ratio in degrees
|
Math.atan(number)
|
Y
|
Arc tan of ratio in radians
|
Math.atandeg(number)
|
Y
|
Arc tan of ratio in degrees
|
Math.atan2(y,x)
|
Y
|
Arc tan (angle in radians) of specified coordinates
|
Math.atan2deg(y,x)
|
Y
|
Arc tan (angle in degrees) of specified coordinates
|
Math.ceil(number)
|
N
|
Returns closest integer >= specified number
|
Math.chance(percent)
|
N
|
Returns true (1) percent (on average) amount of the time
|
Math.clamp(number,lo,hi)
|
N
|
if (lo < number < hi) returns number
if (number <= lo) returns lo if (number >= hi) returns hi |
Math.cos(radians)
|
Y
|
Returns the cosine of the angle. Angle is in radians
|
Math.cosdeg(degrees)
|
Y
|
Returns the cosine of the angle. Angle is in degrees
|
Math.degrees(radians)
|
N
|
Converts an angle in radians to degrees
|
Math.exp(number)
|
Y
|
Raises e to the power of number
|
Math.floor(number)
|
N
|
Returns closest integer <= specified number
|
Math.log(number)
|
Y
|
Returns the natural log of number
|
Math.max(number,number...)
|
N
|
Returns the maximum of the supplied Arguments
|
Math.min(number,number...)
|
N
|
Returns the minimum of the supplied Arguments
|
Math.Pi
|
N
|
Constant, PI
|
Math.pow(base,power)
|
Y
|
Raises base to the power of power
|
Math.radians(degrees)
|
N
|
Converts an angle in degrees to radians
|
Math.random()
|
N
|
Returns a random number, 0 <= number <= 1
|
Math.randomInt(max)
|
N
|
Returns a random number in the range
0 <= number <= max |
Math.randomRange(lo,hi)
|
N
|
Returns a random number in the range
lo <= number <= hi |
Math.round(number)
|
N
|
rounds the value of the parameter up or down to the nearest integer
|
Math.sign(number)
|
N
|
if (number < 0) returns -1
if (number == 0) returns 0 if (number > 0) returns +1 |
Math.sin(radians)
|
Y
|
Returns the sine of the angle. Angle is in radians
|
Math.sindeg(degrees)
|
Y
|
Returns the sine of the angle. Angle is in degrees
|
Math.sqrt(number)
|
Y
|
Returns the square root of number
|
Math.SQRT1_2
|
N
|
Constant, square root of 0.5
|
Math.SQRT2
|
N
|
Constant, square root of 2
|
Math.tan(radians)
|
Y
|
Returns the tangent of the angle. Angle is in radians
|
Math.tandeg(degrees)
|
Y
|
Returns the tangent of the angle. Angle is in degrees
|