Loading

ATAN2

math trigonometry

ATAN2 function returns the polar angle theta (azimut) from the conversion of rectangular coordinates (x, y) to polar coordinates (r, theta). This method computes the phase theta by computing an arc tangent of y/x in the range of ] -pi pi ].

Since 2.6.0, this function can be applied to a list of numeric values.

ATAN2 is available since version 1.2.13.

See also

Signatures

Examples

//x, y [ [ 4 0 ] [ -1 -1 ] [ -4 0 ] [ 0 1 ] [ 0 -1 ] [ -1 0 ] //pi [ -1 -0.00001 ] //-pi [ 0 0 ] ] <% DUP 0 GET 'x' STORE 1 GET 'y' STORE 'x y: ' $x TOSTRING + ' ' + $y TOSTRING + ' ==> ' + $y $x ATAN2 TODEGREES TOSTRING + %> FOREACH