HomeMenu
Jesus · Bible · HTML · CSS · JS · PHP · SVG · Applications

hypot

Description

The hypot of Math for PHP calculate the length of the hypotenuse of a right-angle triangle.

The hypot of Math for PHP hypotenuse is equivalent to sqrt(x*x + y*y)..

Syntax

hypot ( float $x , float $y ) : float

Parameters

x

Length of first side

y

Length of second side

Return

Calculated length of the hypotenuse

Examples

1

<?

$x = 3;
$y = 4;

$return = hypot($x, $y);

echo $return;
5

2

<?

$x = 3;
$y = 4;

$return = sqrt(($x * $x) + ($y * $y));

echo $return;
5