Returns the arctangent (in radians) of a number.
Method of Math
Static
Syntax
atan( x );
Parameters
Parameter | Description |
---|---|
x | A number |
Description
The atan method returns a numeric value between -pi/2 and pi/2 radians.
Because atan is a static method of Math, you always use it as Math.atan(), rather than as a method of a Math object you created.
Examples
The following function returns the arctangent of the variable x:
If you pass getAtan the value 1, it returns 0.7853981633974483; if you pass it the value .5, it returns 0.4636476090008061.
See also
Math.acos, Math.asin, Math.atan2, Math.cos, Math.sin, Math.tan