The hypot() function is a built-in mathematical function in PHP and returns the square root of sum of square of arguments passed. It finds the hypotenuse, hypotenuse is the longest side of a right angled triangle. It is calculated by the formula :
where x and y are the other two sides of the triangle.
- x : the length of first side.
- y: the length of the second side.
Return Type: The return type of hypot(x,y) is Float and it returns the square root of squares of values passed to it as parameters.
Input : x=3, y=4 Output :5 Input :x=9, y=10 Output : 13.453624047074
Below program illustrates the working of hypot() function in PHP:
Related Article: hypot() in C++
- How to get the function name inside a function in PHP ?
- PHP | Ds\Set xor() Function
- D3.js | d3.max() function
- PHP | Ds\Map xor() Function
- PHP | pow( ) Function
- PHP | each() Function
- PHP | Ds\Map put() Function
- PHP | pos() Function
- PHP | min( ) Function
- D3.js | d3.map.set() Function
- CSS | rgb() Function
- PHP | end() Function
- PHP | key() Function
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to email@example.com. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.