Related Functions:

The ATAN2 function returns the arctangent, or inverse tangent, of the specified x- and y-coordinates. The arctangent is the angle from the x-axis to a line containing the origin (0, 0) and a point with coordinates (x_num, y_num). The angle is given in radians between -pi and pi, excluding -pi.

Syntax

=ATAN2(x_num,y_num)

Arguments

Argument Description
x_num The x-coordinate of the point
y_num The y-coordinate of the point

Examples

  A B C
1 Formula Result Notes
2 =ATAN2(1,1) 0.785398163 Arctangent of the point 1,1 in radians, pi/4
3 =ATAN2(-1,-1) -2.35619449 Arctangent of the point -1,-1 in radians, -3*pi/4
4 =ATAN2(-1,-1)*180/PI() -135 Arctangent of the point -1,-1 in degrees
5 =DEGREES(ATAN2(-1,-1)) -135 Arctangent of the point -1,-1 in degrees

Note: If you want the angle returned by the ATAN2 function to be expressed in degrees, you can convert it, using the DEGREES function: =DEGREES(radians)

Note: A positive result represents a counterclockwise angle from the x-axis; a negative result represents a clockwise angle.

Common Function Error(s)

Problem What went wrong
#VALUE! Occurs if either of the supplied arguments are non-numeric
#DIV/0! Occurs if the supplied x_num and y_num arguments are both equal to 0

trigonometry_triangleThe arctangent is the inverse of the tangent. Therefore, for the simple right-angle triangle at right, the arctangent of the opposite side (a), divided by the adjacent side (b) is equal to angle A. With coordinates (x,y) located at angle B in the triangle at right, arctangent is calculated as:   

    \[    A= arctan \left( \frac{a}b \right)\ =\ arctan \left( \frac{y}x \right)    \]

See Wikipedia for more information on Inverse Trigonometric Functions.