Scaleform Studio Lua API Reference: math namespace reference
Math namespace
|
huge = 1.#INF : number
HUGE_VAL
|
The value HUGE_VAL, a value larger than or equal to any other numerical value.
|
pi = 3.1415926535898 : number
PI
|
|
abs ( x ) : number
Returns the absolute value of x.
|
Parameters x : | number |
Number to make absolute.
|
Returns number |
Returns the absolute value of x.
|
|
Returns the arc cosine of x in radians.
|
Parameters x : | number |
A number representing a cosine between -1 and 1.
|
Returns number |
An angle in radians.
|
|
Returns the arc sine of x in radians.
|
Parameters x : | number |
A number representing a sine between -1 and 1.
|
Returns number |
An angle in radians.
|
|
Returns the arc tangent of x in radians.
|
Parameters x : | number |
A number representing a tangent.
|
Returns number |
An angle in radians.
|
|
Returns the arc tangent of y/x in radians.
|
Parameters y : | number |
The y coordinate of the point.
|
x : | number |
The x coordinate of the point.
|
Returns number |
An angle in radians.
|
|
Returns the smallest integer larger than or equal to x.
|
|
cos ( x ) : number
Returns the cosine of x
|
Parameters x : | number |
An angle in radians.
|
Returns
|
Returns the hyperbolic cosine of x.
|
Parameters x : | number |
An angle in radians.
|
Returns number |
The hyperbolic cosine of x.
|
|
deg ( x ) : number
Converts an angle in radians in degrees.
|
Parameters x : | number |
An angle in radians.
|
Returns number |
An angle in degrees.
|
|
exp ( x ) : number
Returns the value e^x.
|
Parameters x : | number |
A number representing a power.
|
Returns
|
Returns the largest integer smaller than or equal to x.
|
|
fmod ( x, y ) : number
Returns the remainder of the division of x by y that rounds the quotient towards 0.
|
Parameters x : | number |
The dividend.
|
y : | number |
The divisor.
|
Returns
|
frexp ( x ) : number, number
Returns m and e such that x = m2^e, e is an integer and the absolute value of m is in the
range [0.5, 1) or 0 when x is 0.
|
Parameters x : | number |
A number representing x in x = m2^e
|
Returns number |
m in x = m2^e
|
number |
e in x = m2^e
|
|
Returns m2^e.
|
Parameters m : | number |
The significand.
|
e : | integer |
An integer exponent.
|
Returns number |
Returns the value of m2^e.
|
|
log ( x ) : number
Returns the natural logarithm of x.
|
Parameters Returns number |
The natural logarithm of x.
|
|
Returns the base-10 logarithm of x.
|
Parameters Returns number |
The base-10 logarithm of x.
|
|
max ( x ) : number
Returns the maximum value among its arguments.
|
Parameters x : | number+ |
A series of numbers.
The + notation indicates that there may be one or more instances of the specified type. |
Returns number |
The maximum number.
|
|
min ( x ) : number
Returns the minimum value among its arguments.
|
Parameters x : | number+ |
A series of numbers.
The + notation indicates that there may be one or more instances of the specified type. |
Returns number |
The maximum number.
|
|
mod ( x ) : number, number
Returns two numbers, the integral part of x and the fractional part of x.
|
Parameters Returns number |
The integral part of x.
|
number |
The fractional part of x.
|
|
modf ( x ) : number, number
Returns two numbers, the integral part of x and the fractional part of x.
|
Parameters Returns number |
The integral part of x.
|
number |
The fractional part of x.
|
|
pow ( x, y ) : number
Returns x^y.
|
Parameters x : | number |
A number.
|
y : | number |
A number for the power.
|
Returns number |
The value of x raised to the power.
|
|
rad ( x ) : number
Converts an angle in degrees to radians.
|
Parameters x : | number |
An angle in degrees.
|
Returns number |
The angle in radians.
|
|
Returns a uniform pseudo-random real number in the range [0,1).
|
Parameters | This function does not accept any parameters. |
Returns number |
A uniform pseudo-random real number in the range [0,1).
|
|
Returns a uniform pseudo-random integer in the range [1, m].
|
Parameters m : | number |
The maximum number.
|
Returns number |
A uniform pseudo-random integer in the range [1, m].
|
|
Returns a uniform pseudo-random integer in the range [m, n].
|
Parameters m : | number |
The minimum number.
|
n : | number |
The maximum number.
|
Returns number |
A uniform pseudo-random integer in the range [m, m].
|
|
Sets x as the seed for the pseudo-random generator.
|
Parameters Returns | This function does not return any values. |
|
sin ( x ) : number
Returns the sine of x.
|
Parameters x : | number |
An angle in radians.
|
Returns number |
The sine of x in radians.
|
|
Returns the hyperbolic sine of x.
|
Parameters x : | number |
An angle in radians.
|
Returns number |
The hyperbolic sine of x.
|
|
Returns the square root of x.
|
Parameters x : | number |
A non-negative number.
|
Returns number |
The square root of x.
|
|
tan ( x ) : number
Returns the tangent of x.
|
Parameters x : | number |
Angle in radians
|
Returns
|
Returns the hyperbolic tangent of x.
|
Parameters x : | number |
Angle in radians.
|
Returns number |
The hyperbolic tangent of x.
|
math.huge = 1.#INF : number
HUGE_VAL
A numeric value.
math.pi = 3.1415926535898 : number
PI
math.abs (x) : number
Returns the absolute value of x.
x : number
Number to make absolute.
number
Returns the absolute value of x.
math.acos (x) : number
Returns the arc cosine of x in radians.
x : number
A number representing a cosine between -1 and 1.
number
An angle in radians.
math.asin (x) : number
Returns the arc sine of x in radians.
x : number
A number representing a sine between -1 and 1.
number
An angle in radians.
math.atan (x) : number
Returns the arc tangent of x in radians.
x : number
A number representing a tangent.
number
An angle in radians.
math.atan2 (y, x) : number
Returns the arc tangent of y/x in radians.
y : number
The y coordinate of the point.
x : number
The x coordinate of the point.
number
An angle in radians.
math.ceil (x) : number
Returns the smallest integer larger than or equal to x.
x : number
A number.
number
An integer.
math.cos (x) : number
Returns the cosine of x
x : number
An angle in radians.
number
The cosine of x.
math.cosh (x) : number
Returns the hyperbolic cosine of x.
x : number
An angle in radians.
number
The hyperbolic cosine of x.
math.deg (x) : number
Converts an angle in radians in degrees.
x : number
An angle in radians.
number
An angle in degrees.
math.exp (x) : number
Returns the value e^x.
x : number
A number representing a power.
number
The value e^x.
math.floor (x) : number
Returns the largest integer smaller than or equal to x.
x : number
A number.
number
An integer.
math.fmod (x, y) : number
Returns the remainder of the division of x by y that rounds the quotient towards 0.
x : number
The dividend.
y : number
The divisor.
number
The remainder.
math.frexp (x) : number, number
Returns m and e such that x = m2^e, e is an integer and the absolute value of m is in the
range [0.5, 1) or 0 when x is 0.
x : number
A number representing x in x = m2^e
number
m in x = m2^e
number
e in x = m2^e
math.ldexp (m, e) : number
Returns m2^e.
m : number
The significand.
e : integer
An integer exponent.
number
Returns the value of m2^e.A strictly integral numeric value, with no decimal component.
math.log (x) : number
Returns the natural logarithm of x.
x : number
A number.
number
The natural logarithm of x.
math.log10 (x) : number
Returns the base-10 logarithm of x.
x : number
A number.
number
The base-10 logarithm of x.
math.max (x) : number
Returns the maximum value among its arguments.
x : number+
A series of numbers.The + notation indicates that there may be one or more instances of the specified type.
number
The maximum number.
math.min (x) : number
Returns the minimum value among its arguments.
x : number+
A series of numbers.The + notation indicates that there may be one or more instances of the specified type.
number
The maximum number.
math.mod (x) : number, number
Returns two numbers, the integral part of x and the fractional part of x.
x : number
A number.
number
The integral part of x.
number
The fractional part of x.
math.modf (x) : number, number
Returns two numbers, the integral part of x and the fractional part of x.
x : number
A number.
number
The integral part of x.
number
The fractional part of x.
math.pow (x, y) : number
Returns x^y.
x : number
A number.
y : number
A number for the power.
number
The value of x raised to the power.
math.rad (x) : number
Converts an angle in degrees to radians.
x : number
An angle in degrees.
number
The angle in radians.
math.random () : number
Returns a uniform pseudo-random real number in the range [0,1).
number
A uniform pseudo-random real number in the range [0,1).
math.random (m) : number
Returns a uniform pseudo-random integer in the range [1, m].
m : number
The maximum number.
number
A uniform pseudo-random integer in the range [1, m].
math.random (m, n) : number
Returns a uniform pseudo-random integer in the range [m, n].
m : number
The minimum number.
n : number
The maximum number.
number
A uniform pseudo-random integer in the range [m, m].
math.randomseed (x)
Sets x as the seed for the pseudo-random generator.
x : number
The seed.
math.sin (x) : number
Returns the sine of x.
x : number
An angle in radians.
number
The sine of x in radians.
math.sinh (x) : number
Returns the hyperbolic sine of x.
x : number
An angle in radians.
number
The hyperbolic sine of x.
math.sqrt (x) : number
Returns the square root of x.
x : number
A non-negative number.
number
The square root of x.
math.tan (x) : number
Returns the tangent of x.
x : number
Angle in radians
number
The tangent of x.
math.tanh (x) : number
Returns the hyperbolic tangent of x.
x : number
Angle in radians.
number
The hyperbolic tangent of x.Indicates a table.
This documentation uses the term table to mean an anonymous, temporary Lua table that contains named data values. You typically use these tables to pass data or settings to a function, or to hold data returned by a function.Indicates an object.
This documentation uses the term object to mean a named Lua table or userdata value that maintains a state. Some object types may have multiple instances existing at the same time, each with its own state; these objects typically have creation functions or accessors that you must call in order to get an instance. Some object types have only one instance, which you always access through the object's name.Indicates a named variable within a namespace, object or table; or an element within an enumeration.Indicates a code sample.Indicates an enumeration.
This documentation uses the term enumeration to mean a named Lua table that contains only a set of constant values. These values typically identify a predefined set of options for some setting or behavior. You might pass an enumeration value to a function, or test the value returned by a function against the items in the enumeration to see which option is currently set.Indicates a named variable within a namespace or object that has a pre-set constant value.Indicates a category: a semantic grouping of related API elements.Indicates a namespace.
This documentation uses the term namespace to mean a named Lua table that exists in only one single instance, intended as a container for an interface of related objects, functions and data variables.Indicates an output value returned by a function.Indicates a named function within a namespace or object.Indicates an input parameter for a function.