Others



JavaScript Math.atan()


The Math.atan(x) method returns the arctangent(inverse of tangent) of a number in radians.

Syntax
Math.atan(x)

Here, atan() is a static method. Hence, we use it as Math.atan().

Parameters
  • x - (Required).A number for which we want to compute the arcsine.
Return Value
  • The arctangent value of the given angle.
  • NaN - Non-numeric value.
Example
console.log(Math.atan(5));  //1.373400766945016
console.log(Math.atan(-3));   //-1.2490457723982544
console.log(Math.atan(0));   //0
console.log(Math.atan(1));   //0.7853981633974483
console.log(Math.atan('A')); //NaN
Try it Yourself

JavaScript Math Functions