PHP hypot() Function

What is hypot Function?
Calculate hypotenuse lenth of a right-angle triangle.

Explanation

The "hypot()" function is used to calculate the length of the hypotenuse of a right-angle triangle.

Syntax:


hypot(x,y)

In the above syntax "x", "y" are the coordinates of a triangle, whose hypotenuse has to be calculated.

Example :


<?php
echo hypot(3,6). "<br /;>";
echo hypot(1,3);
?>
Result :

6.7082039325
3.16227766017

In the above example the length of the hypotenuse of two right angled triangles are calculated.

PHP Topics


Ask Questions

Ask Question