The function ATAN2 returns the arctan2 of given x and y coordinates.
ATAN2(x, y) -> arctangent
- x (required, type: Number)
- Any number; this represents the x-coordinate.
- y (required, type: Number)
- Any number; this represents the y-coordinate.
- arctangent (type: Number)
- The angle, in radians, between the positive x-axis and the ray to the point (x, y).
The following example returns the arctan2 of the coordinates (1, 1). Note that the angle between the positive x-axis and the ray to the point (1, 1) is forty-five degrees, or 0.25π radians, but the ATAN2 function doesn't output an angle in degrees or in radians in terms of pi. Rather, it provides a numerical estimation of the angle in radians:
ATAN(1) -> 0.7853981633974483
DEGREES(ATAN2(1, 1)) -> 45
ATAN2 can also be used in tandem with the PI function to provide insight into how the angle in radians relates to terms of pi, such as in the following example:
ATAN2(1, 1)/PI() -> 0.25