Method: CCMath.atan2

Defined in:
lib/ccmath.rb

.atan2(y, x) ⇒ Object



9
10
11
12
13
14
15
# File 'lib/ccmath.rb', line 9

def atan2(y,x)
  if y.real? and x.real?
    atan2!(y,x)
  else
    (-1.0).i * log((x + 1.0.i * y) / sqrt(x * x + y * y))
  end
end