Loading

HYPOT

math trigonometry

HYPOT function returns the radius r from the conversion of rectangular coordinates (x, y) to polar coordinates (r, theta), r = sqrt(x²+y²).

Since 2.6.0, this function can be applied to a LIST of numerical values and a numerical value. Considering this fonction as F, the result of $a [ $b $c ] F is [ $a $b F $a $c F ] and the result of [ $a $b ] $c F is [ $a $c F $b $c F ].

Since 2.7.1, this function can be applied to a GTS of numerical values. This is very similar to how this function works on LISTs, considering the values of the GTS. In that case the result is a GTS.

HYPOT is available since version 1.0.0.

See also

Signatures

Examples

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