atan2()

Returns the arctangent of the quotient of two given numbers, considering the quadrant of the result.

Syntax

atan2(y, x)

Parameters

Parameter Type Description
y Number The numerator (y-coordinate).
x Number The denominator (x-coordinate).

Return Value

Examples

atan2(0, 1);    // returns 0
atan2(1, 0);    // returns pi()/2
atan2(-1, -1);  // returns -3*pi()/4

See also

pi
sin
asin
cos
acos
tan
atan
atan2
rad2deg
deg2rad