Vadim Pirogov wrote in post #1035959:

> def my_l = l(h, R, r)
> Math.sqrt(h**2+(R-r)**2)
> end                     # <= Here problem

To define and call a method, just write:

def l(h, r1, r2)
  Math.sqrt(h**2 + (r1-r2)**2)
end

l(10, 20, 30)
=> 14.142135623730951

-- 
Posted via http://www.ruby-forum.com/.