Quote:
Originally Posted by Betty Boop
*The output is not yet multiplied to pi so that it is expressed in pi radians.
input: y = 1, x = 2
output: 0.1482 (correct)
input: y = -1, x = 2
output: -0.1482 (correct)
input: y = 1, x = -2
output: 0.8542 (even the sign is wrong)
input: y = -1, x=-2
output: -0.8518 (sign is again wrong and from my observation, it doesn't take into account the sign of x)
|
Those outputs are all correct. See attachment.
Starting from the +X axis and going counterclockwise, atan2 goes from 0 to +pi
Starting from the +X axis and going clockwise, atan2 goes from 0 to -pi.