atan2()
From Wiki077
float atan2(float y, float x)
Compute the arctangent of y/x. This is more stable than atan() since it can use the signs of y and x to determine the quadrant the angle is in. It also handles the case where x is zero correctly, returning 90 or -90.
Examples
atan2(1, 0) = 90
atan2(0, 1) = 0
atan2(0, -1) = 180
See Also
acos(), asin(), atan(), cos(), cosh(), sin(), sinh(), tan(), tanh()
