Type Function Library math.* Return value Number Revision Release 2024.3703 Keywords atan, arc tangent See also math.tan()
Returns the arc tangent of a x
in radians. The result will be in the range -pi/2
to pi/2
.
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