JavaScript Tutorial





Español Français 中文 Deutsch Portuguese Japanese nederlands
   
 
Java-Script Tutorial
Introduction Introduction
Variables Variables
Operators Operators
Statements Statements
Loops Loops
Functions Functions
Objects Objects
Arrays Arrays
Cookies JS Cookies
Browser Objects Browser Objects
Form DOM Form DOM
Style Objects DOM Style Objects
Forums Ask Your Doubts
Scraps More about Javascript
Feedback Feedback
 




Math.atan() Method - Math Functions


Tutorials Javascript

Topic

Math.atan() method of Math Functions in Javascript.
How to get the arctangent value of a number in javascript?



Explanation

Object: Math

Method: Math.atan()

Description: To get the arctangent value for a number using Math Functions. This function returns the value in the range of -PI/2 and PI/2 radians.

Example:
<script type="text/javascript">
document.write('Arctangent of 2 is::'+Math.atan(2));
document.write('</br>');
document.write('Arctangent of 0 is::'+Math.atan(0));
document.write('</br>');
document.write('Arctangent of -1 is::'+Math.atan(-1));
</script>

Result:


In the above example,
  • Math.atan() function returns value for 2 is 1.107148 radians, but for 0 it is 0.
  • The atan value returned for the number -1 is -0.78539.






  • A Note
    Javascript (JS) is one of the most used languages in the world. Some times spelled as Java Script. Hope you enjoy this tutorial. Do send your feedback or suggestions on this javascript or java script tutorial. This is a copyright content.

    Other Links

    web hosting