Math.hypot

Math.hypot

Math.hypot

Function

hypotenuse length. Returns the length of the hypotenuse of sqrt(x x + y y).

Syntax

Parameters

ParametersTypeRequiredDefault valueDescription
xNumberYesNoneRight side x.
yNumberYesNoneRight angle side y.

Return value

TypeDescription
Int/FloatReturns the length of the hypotenuse of sqrt(x x + y y). An Int is returned for integer results, and a Float for non-integer or non-finite results.

Example

Notes

  • Internally uses Rust f64's hypot operation.