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
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:
To calculate the arctan2 in degrees, the ATAN2 function must be used in tandem with the DEGREES function, such as in the following example:
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:
Last updated