ATAN2

The function ATAN2 returns the arctan2 of given x and y coordinates.

This function takes two Numbers, call them x and y, as input. It returns another Number: the angle, in radians, between the positive x-axis and the ray to the point (x, y). 

Declaration

ATAN2(x, y) -> arctangent

 

Parameters

x (required, type: Number)
Any number; this represents the x-coordinate.

y (required, type: Number)
Any number; this represents the y-coordinate.

Return Values

arctangent (type: Number)
The angle, in radians, between the positive x-axis and the ray to the point (x, y). 

Examples

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

To calculate the arctan2 in degrees, the ATAN2 function must be used in tandem with the DEGREES function, such as in the following example:

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