<?php
float hypot ( float $x , float $y )
where,
$x = The length of the first side
$y = The length of the second side
?>
<?php
$x = 30;
$y = 40;
$h01a = hypot($x, $y);
$h01b = sqrt($x**2 + $y**2);
/*
The same as:
$h01b = sqrt($x*$x + $y*$y);
*/
if($h01a == $h01b)
{
echo 'Both values are equal!<br><br>';
echo 'hypot( ' . $x . ', ' . $y . ' ) = ' . $h01a . '<br><br>';
echo 'sqrt( ' . $x . '**2 + ' . $y . '**2 ) = ' . $h01b . '<br><br>';
}
else
{
echo 'Both values are different!<br><br>';
echo $h01a . ' ≠ ' . $h01b . '<br><br>';
}
?>
<?php
// setlocale(LC_ALL, 'de_DE', 'de-DE');
$x = M_PI;
$y = 2*M_PI;
$h01a = hypot($x, $y);
echo 'hypot( ' . $x . ', ' . $y . ' ) =<br>= ' . $h01a;
?>