How to use hypot in PHP

This article describe about hypot() Function in PHP.
  • 1237

hypot() Function

This function returns the length of the hypotenuse of a right-angle triangle.

Syntax

hypot(p,q)

 

Parameter Description
p Length of side p.
q Length of side q.

Example

<html>
<body>
<?php
echo hypot(5,6) . "<br />";
echo hypot(4,8) . "<br />";
echo hypot(4,8) . "<br />";
echo hypot(2,6);
?>
</body>
</html>

 

Output


hypotphp.jpg

You may also want to read these related articles Click here

Ask Your Question 

Got a programming related question? You may want to post your question here

Programming Answers here

Categories

More Articles

© 2020 DotNetHeaven. All rights reserved.