Skip to main content
Mail a PDF copy of this page to:
(Your email address will not be added to a mailing list)
Show menu

ATAN2 function


Arc tangent of two numbers, or four-quadrant inverse tangent. ATAN2(y,x) returns the arc tangent of the two numbers x and y. It is similar to calculating the arc tangent of y / x, except that the signs of both arguments are used to determine the quadrant of the result.

The result is an angle expressed in radians. To convert from radians to degrees, use the DEGREES function.

In terms of the standard arc tangent function, atan2 can be expressed as follows:

Definition of ATAN2$$ \operatorname{atan2}(y,x) = \begin{cases} \arctan(\frac y x) &\text{if } x > 0 \\ \arctan(\frac y x) + \pi &\text{if } x < 0 \text{ and } y \ge 0 \\ \arctan(\frac y x) - \pi &\text{if } x < 0 \text{ and } y < 0 \\ +\frac{\pi}{2} &\text{if } x = 0 \text{ and } y > 0 \\ -\frac{\pi}{2} &\text{if } x = 0 \text{ and } y < 0 \\ \text{undefined} &\text{if } x = 0 \text{ and } y = 0 \end{cases}$$

Note that in Excel the parameters y and x are reversed.




ATAN2 function
Function: ATAN2(,)
  X-axis Y-axis

Related functions

External links