How to use the ATAN2 function
What is the ATAN2 function?
The ATAN2 function calculates the arctangent of an angle using specific x- and y-coordinates. The returned angle is in radians between -pi to pi, including pi. The angle is between the x-axis and the line from (0,0) and point (x_num, y_num)
Atan2 is more useful when converting cartesian (x,y) to polar (r,θ)
What is the difference between atan2 and atan?
Atan handles only angles in the first quadrant while atan2 covers all quadrants.
When to use the atan2 function?
The atan2 function is more useful than atan for converting from cartesian (x,y) coordinates to polar (r,θ) form because it correctly handles all quadrants and signs to determine the full angular direction θ.
What is cartesian (x,y)?
The Cartesian coordinate grid has an x-axis running left-to-right and a y-axis running up-and-down meaning it has two axis or dimensions (2D). Cartesian coordinates are just a way to capture any point on a 2D grid using an x and y value.
What is a quadrant?
The Cartesian coordinate grid has 4 quadrants formed by the x-axis and the y-axis.
Each quadrant has a combination of positive or negative x and y values:
- Quadrant 1 is the upper right with positive x and positive y.
- Quadrant 2 is the upper left with negative x but positive y.
- Quadrant 3 is the lower left with negative x and negative y.
- Quadrant 4 is the lower right with positive x but negative y.
The signs of the (x,y) coordinates tell you which quadrant a given point is located in.
What is a sign?
The sign tells you if a numeral value is positive or negative. For example, if x is -5 and y is -10 then the coordinate is in the third quadrant.
What is polar (r,θ)?
Polar coordinates identify points using a distance r and angle θ. r is the distance of the point from the center origin. θ (theta) is the angle between the point and the positive x-axis.
For example, (5, 100°) in polar coordinates represents r=5 units from the origin or intersection of the x and y axis. The angle θ=100 degrees is related to the x-axis counterclockwise.
Excel Function Syntax
ATAN2(x_num, y_num)
Arguments
x_num | Required. The x-coordinate. |
y_num | Required. The y-coordinate. |
Comments
If x_num is 1 and y_num is 1 then the angle between the x-axis and the line from (0,0) to (1,1) is 45 degrees or 1/4 pi radians. 1/4 pi is 0.785398163.
Functions in 'Math and trigonometry' category
The ATAN2 function function is one of many functions in the 'Math and trigonometry' category.
How to comment
How to add a formula to your comment
<code>Insert your formula here.</code>
Convert less than and larger than signs
Use html character entities instead of less than and larger than signs.
< becomes < and > becomes >
How to add VBA code to your comment
[vb 1="vbnet" language=","]
Put your VBA code here.
[/vb]
How to add a picture to your comment:
Upload picture to postimage.org or imgur
Paste image link to your comment.
Contact Oscar
You can contact me through this contact form