atan2

atan2

> Functions

Converts the Cartesian coordinates (x*, *y) into polar coordinates (r*, *theta). This function returns the angle theta, between -PI and PI, using the signs of the arguments.

Parameters
Return
Note

Watch out: the arguments really are in the order Y* then *X, which is a little counter-intuitive.

Examples

atan2(1, 1) // PI / 4 atan2(-1, 1) // -PI / 4 atan2(1, -1) // 3 * PI / 4 atan2(-1, -1) // -3 * PI / 4