Logo

Programming-Idioms

History of Idiom 200 > diff from v6 to v7

Edit summary for version 7 by Isotopp:
New PHP implementation by user [Isotopp]

Version 6

2019-09-29, 11:24:18

Version 7

2019-09-29, 11:31:24

Idiom #200 Return hypotenuse

Returns the hypotenuse h of the triangle where the sides adjacent to the square angle have lengths x and y.

Idiom #200 Return hypotenuse

Returns the hypotenuse h of the triangle where the sides adjacent to the square angle have lengths x and y.

Extra Keywords
pythagore square geometry trigo trigonometry
Extra Keywords
pythagore square geometry trigo trigonometry
Code
$h = hypot($x, $y)

// before PHP 4.1
$h = sqrt($x*$x + $y*$y);
Doc URL
https://www.php.net/manual/en/function.hypot.php