Quote:
|
Originally Posted by kaszeta
In short, if I calculate the angle using the atan() function, the results work when y>0, but give incorrect and discontinous results if y<0.
|
That's just the nature of arc tangents. You need to determine which quadrant you're in and offset the answer accordingly. Some trig libraries provide an atan2() function that deals with the issue for you.