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

ATAN2 function

Description

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.

Calculator

ATAN2(  ,  

Graph

ATAN2 function

Related functions

External links