math.acos()

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

Overview

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.

Syntax

math.acos( x )
x (required)

Number. A number.

Examples

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