Type Function
Library math.*
Return value Number
Revision Current Public Release (2017.3068)
Keywords acos, arc cosine
See also math.cos()


Returns the arc cosine of x in radians. The result will be in the range 0 to pi. If the parameter x is outside the range [-1..1], the result will be NaN.


math.acos( x )
x (required)

Number. A number.


local x = math.acos(1)    -- result will be 0
local y = math.acos(-1)    -- result will be 3.14159...
local z = math.acos(1.1)   -- result will be NaN