Logo

Programming-Idioms

History of Idiom 200 > diff from v8 to v9

Edit summary for version 9 by mushr00m_Dev:
New Elixir implementation by user [mushr00m_Dev]

Version 8

2019-09-30, 14:57:04

Version 9

2019-09-30, 15:41:12

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
def sq(x) do
  x*x
end

def hypo(a,b) do
  sqrt(sq(a) + sq(b))
end