acos()

Anonymous contributor's avatar
Anonymous contributor
Published Oct 14, 2023
Contribute to Docs

The acos() method of the Lua math library returns the arc cosine of the argument, in radians.

Syntax

math.acos(x)

Where -1 <= x <= 1.

Example

The code below will print the arc cosine of 0.5 to the console.

print(math.acos(0.5))

The output will be:

1.0471975511966

All contributors

Contribute to Docs

Learn Lua on Codecademy