hypot - chung-leong/qb GitHub Wiki

hypot - Length of the hypotenuse of a right-angle triangle

float hypot( float $x, float $y )

hypot() calculates the length of the hypotenuse of a right-angle triangle with sides of length x and y, or the distance of the point ( x, y ) from the origin. This is equivalent to sqrt( x * x + y * y ).

Parameters:

x - The length of the first side. It can be a scalar or an array.

y - The length of the second side. It can be a scalar or an array.

Return Value:

Length of the hypotenuse. If x or y is an array, then return value is also an array, the size of which match the larger of x and y.

Version

1.0 and above.