Wish rotation matched aTan2.

Monkey Forums/Monkey Programming/Wish rotation matched aTan2.

ondesic(Posted 2013) [#1]
Is there an easy way to change DrawImage so that the rotation angle matches what you get back from aTan2? It seems that rotation moves counter clockwise and atan2's angle moves clockwise.

Right now if I want to move a sprite from point A to point B, AND have the image faceing that direction, I have to do extra calculations.

Do I need to change the mojo code?


Oddball(Posted 2013) [#2]
I found this frustrating too, especially as in BlitzMax they do match. The easiest way to correct the angle is to make the DrawImage rotation the negative of ATan2. So -ATan2(y,x) should give you the right angle for DrawImage.