This library is an interface to the standard C math library. The functions are listed below.
Description: Returns the absolute value of x
Description: Returns the arc cosine of x
Description: Returns the arc sine of x
Description: Returns the arc tangent of x (in radians)
Description: Returns the arc tangent of y/x (in radians), but uses the signs of both parameters to find the quadrant of the result. It also handles correctly the case of x being zero.
Description: Returns the smallest integer larger than or equal to x.
Description: Returns a number between min and max, inclusive.
Description: Returns the cosine of x (assumed to be in radians).
Description: Returns the hyperbolic cosine of x.
Description: Returns the angle x (given in radians) in degrees.
Description: Returns the value e^x.
Description: Returns the largest integer smaller than or equal to x.
Description: Returns the remainder of the division of x by y that rounds the quotient towards zero.
Description: Returns m and e such that x = m*2^e, e is an integer and the absolute value of m is in the range [0.5, 1) (or zero when x is zero).
Description: Returns m*2^e (e should be an integer).
Description: Returns the natural logarithm of x.
Description: Returns the base-10 logarithm of x.
Description: Returns the maximum value among the numbers passed to the function.
Description: Returns the minimum value among the numbers passed to the function.
Description: Returns two numbers, the integral part of x and the fractional part of x.
Description: Returns a perlin noise value between -0.5 and 0.5. If you leave arguments out, they will be interpreted as zero, so
math.noise(1.158) is equivalent to
math.noise(1.158, 0, 0) and
math.noise(1.158, 5.723) is equivalent to
math.noise(1.158, 5.723, 0).
The function uses a perlin noise algorithm to assign fixed values to coordinates. For example,
math.noise(1.158, 5.723) will always return
math.noise(1.158, 6) will always return
If x, y and z are all integers, the return value will be 0. For fractional values of x, y and z, the return value will gradually fluctuate between -0.5 and 0.5. For coordinates that are close to each other, the return values will also be close to each other.
Description: Returns x^y. (You can also use the expression x^y to compute this value.)
Description: Returns the angle x (given in degrees) in radians.
Description: This function is an interface to the simple pseudo-random generator function rand provided by ANSI C. (No guarantees can be given for its statistical properties.) When called without arguments, returns a uniform pseudo-random real number in the range [0,1). When called with an integer number m, math.random returns a uniform pseudo-random integer in the range [1, m]. When called with two integer numbers m and n, math.random returns a uniform pseudo-random integer in the range [m, n].
Description: Sets x as the seed for the pseudo-random generator: equal seeds produce equal sequences of numbers.
Description: Returns -1 if x < 0, 0 if x == 0, or 1 if x > 0.
Description: Returns the sine of x (assumed to be in radians).
Description: Returns the hyperbolic sine of x.
Description: Returns the square root of x. (You can also use the expression x^0.5 to compute this value.)
Description: Returns the tangent of x (assumed to be in radians).
Description: Returns the hyperbolic tangent of x.
Description: The value HUGE_VAL, a value larger than or equal to any other numerical value.
Description: The value of pi.