Facebook Page Twitter Page LinkedIn Page
× PHP Tutorial PHP Advanced PHP Resources


The PHP Math hypot() function returns square root of sum of squares of two arguments, i.e., sqrt(x2 +y2).

Syntax

hypot(x, y)

Parameters

x Required. Specify a value.
y Required. Specify a value.

Return Value

Returns sqrt(x2 +y2).

Example:

In the below example, hypot() function returns sqrt(x2 +y2).

<?php
echo hypot(3, 4)."\n";
echo hypot(5, 12)."\n";
echo hypot(8, 15)."\n";  
?>

The output of the above code will be:

5
13
17

❮ PHP Math Functions

5