PHP: hypot() function
Description
The hypot() function is used to calculate the length of the hypotenuse of a right-angle triangle.
Version:
(PHP 4 and above)
Syntax:
hypot (nx,ny )
Parameter:
Name | Description | Required / Optional |
Type |
---|---|---|---|
nx | Length of first side | Required | Float |
ny | Length of second side | Required | Float |
Return value:
The length of the hypotenuse.
Value Type: Float.
Example:
<?php
echo hypot(3,4) . "<br />";
echo hypot(3,5) . "<br />";
echo hypot(4,7) . "<br />";
echo hypot(2,6);
?>
Output:
5 5.83095189485 8.0622577483 6.32455532034
View the example in the browser
See also
It will be nice if you may share this link in any developer community or anywhere else, from where other developers may find this content. Thanks.
https://www.w3resource.com/php/function-reference/hypot.php
- Weekly Trends and Language Statistics
- Weekly Trends and Language Statistics