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

true

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

y

Number

true

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
\