The atan() method returns the arctangent of a number as a value between -PI/2 and PI/2 radians.

The atan() method returns the arctangent of a number as a value between -PI/2 and PI/2 radians.

Math.atan(x)

Parameter | Require | Description |
---|---|---|

x | Required. | A number |

A Number, from -PI/2 to PI/2, or NaN if the value is empty

Return the arctangent of a specified number:

//display the arctangent of the number 2 console.log(Math.atan(2));