Math.atan(value) Last updated: 16. May 2026
Returns the arctangent (in radians) of a number. The returned value is between -π/2 and π/2.
Parameters
| Name | Type | Description |
|---|---|---|
| value | number | A number representing the tangent of an angle. |
Returns
A number between -π/2 and π/2 radians, representing the angle whose tangent is the given value.
Example
Code example (JS)
JS is normal JavaScript either running in the browser or on the Docly™ server.write(Math.atan(1));
write("\n");
write(Math.atan(0));
write("\n");
/* atan(1) = π/4 ≈ 0.7853981633974483
atan(0) = 0
Expected output:
0.7853981633974483
0
*/ Output
The JS code above produces the output shown below:0.7853981633974483
0