Javascript Math atan()

Introduction

The Math.atan() function returns the arctangent in radians of a number.

Math.atan(x)   // x is a number.
let a = Math.atan(1);   // 0.7853981633974483
console.log(a);//from  w  ww .  jav a  2s  .  c  o m
a = Math.atan(0);   // 0
console.log(a);
a = Math.atan(-0);  // -0
console.log(a);
a = Math.atan(Infinity);   //  1.5707963267948966
console.log(a);
a = Math.atan(-Infinity);  // -1.5707963267948966
console.log(a);



PreviousNext

Related