Documentation/Calc Functions/ATAN2

Function name:
ATAN2

Category:
Mathematical

Summary:
Calculates the inverse trigonometric tangent (arctangent or arctan) for the specified x and y coordinates. That is, the angle (in radians) between the x-axis and a line from the origin to the specified (x, y) point. The value returned is the principal value and lies in the range (-&pi;, &pi;] radians.

Syntax:
ATAN2(Number X; Number Y)

Returns:
Returns a real number in the range (-&pi;, &pi;] that is the inverse trigonometric cosine in radians for the specified x and y coordinates.

If the function returns a positive angle it represents a counterclockwise angle from the x-axis, while a negative result represents a clockwise angle.

Arguments:
Number X is a real number, or a reference to a cell containing that number, that is the value of the x coordinate.

Number Y is a real number, or a reference to a cell containing that number, that is the value of the y coordinate.


 * If either Number X or Number Y is non-numeric, then ATAN2 returns a #VALUE! error.


 * If Number X and Number Y are both equal to 0, then ATAN2 returns the value 0.

Additional details:
The following illustration shows the geometry used by ATAN2 (φ is the angle calculated).


 * To return the angle in degrees, use the DEGREES function.
 * Alternatively multiply by 180/PI to convert the result from radians to degrees.


 * Beware that computer programming languages often use the opposite order of arguments for their atan2 functions.

Related LibreOffice functions:
ACOS

ACOT

ASIN

ATAN

TAN

ODF standard:
Section 6.16.10, part 2

Equivalent Excel functions:
ATAN2