Home Javascript JavaScript method atan()
Questions:Ask|Latest


 
 

Share on Google+Share on Google+

JavaScript method atan()

Advertisement
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.

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

Liked it!  Share this Tutorial


Follow us on Twitter, or add us on Facebook or Google Plus to keep you updated with the recent trends of Java and other open source platforms.

Posted on: February 16, 2005

Ask Questions?    Discuss: JavaScript method atan()  

Post your Comment


Your Name (*) :
Your Email :
Subject (*):
Your Comment (*):
  Reload Image
 
 
Comments
DMCA.com