Logo

Programming-Idioms

History of Idiom 200 > diff from v3 to v4

Edit summary for version 4 by 0bit:
New Python implementation by user [0bit]

Version 3

2019-09-28, 22:00:41

Version 4

2019-09-29, 06:27:21

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
Imports
import math
Code
h = math.hypot(x, y)