đĸmath
Functions:
abs
math.abs(x: number):
number
Returns the absolute value of x.
acos
math.acos(x: number):
number
Returns the arc cosine of x (in radians).
asin
math.asin(x: number):
number
Returns the arc sine of x (in radians).
atan
math.atan(x: number):
number
Returns the arc tangent of x (in radians).
atan2
math.atan2(x: number, y: number):
number
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.)
ceil
math.ceil(x: number):
number
Returns the smallest integer larger than or equal to x.
clamp
math.clamp(value: number[, min: number, max: number]):
number
Returns the clamped value.
cos
math.cos(x: number):
number
Returns the cosine of x (assumed to be in radians).
cosh
math.cosh(x: number):
number
Returns the hyperbolic cosine of x.
deg
math.deg(x: number):
number
Returns the angle x (given in radians) in degrees.
exp
math.exp(x: number):
number
Returns the value e power x.
floor
math.floor(x: number):
number
Returns the largest integer smaller than or equal to x.
fmod
math.fmod(x: number, y: number):
number
Returns the remainder of the division of x by y that rounds the quotient towards zero.
frexp
math.frexp(x: number):
number
, number
Returns m
and e
such that x = m2e
, e
is an integer and the absolute value of m
is in the range [0.5, 1)
(or zero when x
is zero).
huge
math.huge
:
number
The value HUGE_VAL, a value larger than or equal to any other numerical value.
ldexp
math.ldexp(x: number, e: number):
number
Returns m2e
(e should be an integer).
log
math.log(x: number):
number
Returns the natural logarithm of x.
log10
math.log10(x: number):
number
Returns the base-10 logarithm of x.
map
math.map(value: number, in_from: number, in_to: number, out_from: number, out_to: number[, should_clamp: boolean]):
number
Linearly maps two number ranges and returns the mapped value.
max
math.max(x: number[, ...]):
number
Returns the maximum value among its arguments.
min
math.min(x: number[, ...]):
number
Returns the minimum value among its arguments.
modf
math.modf(x: number):
number
Returns two numbers, the integral part of x and the fractional part of x.
normalize_yaw
math.normalize_yaw(x: number):
number
Returns the normalized yaw angle value.
pi
math.pi
:
number
The value of pi.
pow
math.pow(x: number, y: number):
number
Returns x^y. (You can also use the expression x^y to compute this value.)
rad
math.rad(x: number):
number
Returns the angle x (given in degrees) in radians.
random
math.random([m [, n]]):
number
This function is an interface to the simple pseudo-random generator function rand provided by ANSI C.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].
randomseed
math.randomseed(x: number):
number
Sets x as the "seed" for the pseudo-random generator: equal seeds produce equal sequences of numbers.
sin
math.sin(x: number):
number
Returns the sine of x (assumed to be in radians).
sinh
math.sinh(x: number):
number
Returns the hyperbolic sine of x.
sqrt
math.sqrt(x: number):
number
Returns the square root of x. (You can also use the expression x^0.5 to compute this value.)
tan
math.tan(x: number):
number
Returns the tangent of x (assumed to be in radians).
tanh
math.tanh(x: number):
number
Returns the hyperbolic tangent of x.
Last updated