hypot

Calculate the length of the hypotenuse of a right-angle triangle

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

abs

acos

acosh

asin

asinh

atan

atan2

atanh

base_convert

bindec

ceil

cos

cosh

decbin

dechex

decoct

deg2rad

exp

expm1

fdiv

floor

fmod

hexdec

intdiv

is_finite

is_infinite

is_nan

log

log10

log1p

max

min

octdec

pi

pow

rad2deg

round

sin

sinh

sqrt

tan

tanh

PHP

Home Menu