atan2

atan2

> Functions

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

Parameters
Return
Note

Be careful, the arguments are indeed 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