Math.atan( ) In JavaScript
The Math.atan( ) function in JavaScript is used to return the arctangent of a number in radians.
Math.atan(x)=arctan(x)=unique y,where y belongs to [-pi/2;pi/2] such that tan(y)=x
The Math.atan() method returns a numeric value between -pi/2 and pi/2 radians.
atan() is a static method of Math, therefore, it is always used as Math.atan(), rather than as a method of a Math object created.
Syntax:
Math.atan(value)
Parameters: This function accepts a single parameter which is a number in radians who arctangent you want to find.
Returns: The Math.atan() function returns the arctangent of the given number in radians.
Examples:
Input : Math.atan(1)
Output : 0.7853981633974483
Input : Math.atan(0)
Output : 0
Input : Math.atan(-0)
Output : -0
Input : Math.atan(Infinity)
Output : 1.5707963267948966
Input : Math.atan(-Infinity)
Output : -1.5707963267948966
- Example 1: When 1 is passed as a parameter.
<scripttype="text/javascript">document.write("Output : " + Math.atan(1));</script>chevron_rightfilter_noneOutput:
Output : 0.7853981633974483
- Example 1: When 0 is passed as a parameter.
<scripttype="text/javascript">document.write("Output : " + Math.atan(0));</script>chevron_rightfilter_noneOutput:
Output : 0
- Example 1: When -0 is passed as a parameter.
<scripttype="text/javascript">document.write("Output : " + Math.atan(-0));</script>chevron_rightfilter_noneOutput:
Output : -0
- Example 1: When Infinity is passed as a parameter.
<scripttype="text/javascript">document.write("Output : " + Math.atan(Infinity));</script>chevron_rightfilter_noneOutput:
Output : 1.5707963267948966
- Example 1: When -Infinity is passed as a parameter.
<scripttype="text/javascript">document.write("Output : " + Math.atan(-Infinity));</script>chevron_rightfilter_noneOutput:
Output : -1.5707963267948966
- Google Chrome
- Internet Explorer
- Firefox
- Opera
- Safari
- Introduction to JavaScript Course | Learn how to Build a task tracker using JavaScript
- How to compare two JavaScript array objects using jQuery/JavaScript ?
- JavaScript Course | Understanding Code Structure in JavaScript
- JavaScript Course | Conditional Operator in JavaScript
- JavaScript Course | Printing Hello World in JavaScript
- JavaScript Course | Logical Operators in JavaScript
- JavaScript Course | Data Types in JavaScript
- JavaScript Course | JavaScript Prompt Example
- JavaScript Course | Loops in JavaScript
- JavaScript Course | Variables in JavaScript
- JavaScript Course | Functions in JavaScript
- JavaScript Course | Operators in JavaScript
- JavaScript Course | Objects in JavaScript
- JavaScript vs Python : Can Python Overtop JavaScript by 2020?
- How to include a JavaScript file in another JavaScript file ?
Supported Browsers: The browsers supported by JavaScipt Math.atan( ) function are listed below:
Recommended Posts:
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to contribute@geeksforgeeks.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.


