The ATAN2 function returns the arctangent of the specified coordinates, which is the angle between the X-axis and a line from the origin to the required point.
This function may be useful in mathematical and engineering calculations where hyperbolic functions are required.
Syntax
ATAN2(x, y)
Argument |
Description |
Permitted values |
|---|---|---|
x |
The x-coordinate of the endpoint of the segment for which the angle from the x-axis needs to be calculated |
Any real number or a reference to a cell containing a number |
y |
The y-coordinate of the endpoint of the segment for which the angle from the x-axis needs to be calculated |
Any real number or a reference to a cell containing a number |
Examples of use
Calculating the angle for point (−1, 1)
=ATAN2(1, 1)
Result: approximately 0.7854 radians (or 45°).
Calculating the angle for point (−1, 1)
=ATAN2(1, −1)
Result: approximately −0.7854 radians (or −45°).
Calculating the angle for point (0, 0)
=ATAN2(0, 0)
The function returns the #DIV/0! error.
Notes
–The function returns a value in radians.
–Please note that the order of the arguments is important.
–The result is a number in radians in the range from −π to π, excluding −π.