atan2(y,x)
returns the arc tangent of y divided by x using the signs of y and x to determine the quadrant
CMath.atan2(1 + 1i, 0) #=> (1.5707963267948966+0.0i)
# File lib/cmath.rb, line 314 def atan2(y,x) begin if y.real? and x.real? RealMath.atan2(y,x) else (-1.0).i * log((x + 1.0.i * y) / sqrt(x * x + y * y)) end rescue NoMethodError handle_no_method_error end end