PHP hypot() Function

PHP Math Reference : Calculate the hypotenuse of different right-angle triangles

Definition and Usage

The hypot() function calculates the hypotenuse of a right-angle triangle.

Tip: This function is equivalent to sqrt(x*x + y*y).

Syntax

hypot(x,y);

Parameter Values

Parameter Description
x Required. Specifies the length of first side
y Required. Specifies the length of second side

Technical Details

Return Value: The length of the hypotenuse
Return Type: Float
PHP Version: 4.1+

❮ PHP Math Reference