math.atan()

Type Function
Library math.*
Return value Number
Revision Release 2022.3683
Keywords atan, arc tangent
See also math.tan()

Overview

Returns the arc tangent of a x in radians. The result will be in the range -pi/2 to pi/2.

Syntax

math.atan( x )
x (required)

Number. A number.

Examples

print("atan(0) = " .. math.atan(0))              --- result is 0
print("atan(inf) = " .. math.atan(math.huge))    --- result is +pi/2
print("atan(-inf) = " .. math.atan(-math.huge))  --- result is -pi/2