Javascript - Math atan() Method

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

Description

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

Syntax

Math.atan(x)

Parameter Values

Parameter RequireDescription
x Required. A number

Return

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

Example

Return the arctangent of a specified number:

Demo

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

Result