Math.atan method

The Math.atan method returns the arctangent of a number. The method parameter must be between -Pi/2 and Pi/2, otherwise NaN will be returned.

Syntax

javascriptMath.atan(number);

Example

Let's output the arctangent of the number 2:

javascriptconsole.log(Math.atan(2));

The code execution result:

javascript1.1071487177940904

See also

  • the Math.cos method
    that returns the cosine of a number
  • the Math.sin method
    that returns the sine of a number
  • the Math.tan method
    that returns the tangent of a number
  • the Math.asin method
    that returns the arcsine of a number
  • the Math.acos method
    that returns the arccosine of a number