Game Development Reference
In-Depth Information
math.asin (x)
This returns the arc sine of the value x in radians.
print(math.asin(1)) -- Prints 1.5707963267949
math.atan (x)
This returns the arctangent of the value x in radians. This is in the range of -pi/2 to pi/2.
print(math.atan(1)) -- Prints 0.78539816339745
-- pi/2
-- -pi/2
-- 0
-- pi
The parameters passed are y and then x , not x,y , as are generally passed.
Note
math.ceil (x)
This returns the integer value of the passed value of x closest to the next integer.
print (math.ceil(0.1)) -- Returns 1
print (math.ceil(0.5)) -- Returns 1
print (math.ceil(0.6)) -- Returns 1
math.cos (x)
This returns the cosine value of x passed in radians.
print(math.cos(1)) -- 0.54030230586814
math.cosh (x)
This returns the hyperbolic cosine of a value.
print(math.cosh(1)) -- 1.5430806348152
 
Search WWH ::




Custom Search