Logo

Programming-Idioms

History of Idiom 200 > diff from v15 to v16

Edit summary for version 16 by programming-idioms.org:
[Go] +DocURL

Version 15

2020-10-15, 12:39:07

Version 16

2020-10-15, 18:20:39

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.

Variables
h,x,y
Variables
h,x,y
Extra Keywords
pythagore square geometry trigo trigonometry
Extra Keywords
pythagore square geometry trigo trigonometry
Imports
import "math"
Imports
import "math"
Code
h := math.Hypot(x, y)
Code
h := math.Hypot(x, y)
Doc URL
https://golang.org/pkg/math/#Hypot
Demo URL
https://goplay.space/#AOKffpMmMQr
Demo URL
https://goplay.space/#AOKffpMmMQr