Math.hypot()

Get the hypotenuse of a right triangle.

Signature

Math.lypot(x: Number, y: Number) => Number

Description

Return the hypotenuse of a right triangle or the square root of the sum of squares.

Parameters

Parameter Type Required Description

x

Number

Yes

A number to be squared and added to the square of y.

y

Number

Yes

A number to be squared and added to the square of x.

Return value

Type Description

Number

Hypotenuse of a right triangle or the sum of the squares of x and y.

Examples

Math.hypot(3, 4)
5.0

Is this article helpful? 

Tell Fauna how the article can be improved:
Visit Fauna's forums or email docs@fauna.com

Thank you for your feedback!