JavaScript method atan()

This section illustrates you the use of JavaScript method atan(). The atan() method returns the arc tangent of a specified number as a numeric value between -PI/2 and PI/2 radians.


 

Ads

Tutorials   
Ads

JavaScript method atan()

     

This section illustrates you the use of JavaScript method atan(). The atan() method returns the arc tangent of a specified number as a numeric value between -PI/2 and PI/2 radians. You can see in the given example that we have used the method atan() and want  to find out the arc tangent of 2. We have created a button which calls the function calculate() from the script and displays the output. 

 

 

 

Here is the code:

<html>
<script>
function calculate(){
document.write("The value of atan(2) is: "+Math.atan(2));
}
</script>
<h2>Use of atan() method</h2>
<button onclick="calculate();">Use of method atan</button>
</body>
</html>

Output will be displayed as:

On clicking the button, you will get the arc tangent of 2:

Download Source Code

     

Advertisements

Share on Google+Share on Google+

JavaScript method atan()

Posted on: February 16, 2005 If you enjoyed this post then why not add us on Google+? Add us to your Circles

Advertisements

 

Discuss: JavaScript method atan()  

Post your Comment


Your Name (*) :
Your Email :
Subject (*):
Your Comment (*):
  Reload Image
 
 
Comments:0

Ads

 

Ads