Get rotation from a vector?

BlitzMax Forums/BlitzMax Programming/Get rotation from a vector?

elcoo(Posted 2009) [#1]
Hi,
let's say I've got an image and a vector ([0.4,0.6] for example) that i'm moving the image along. How can I get the angle that the image needs to be rotated to point in the vectors direction? Must be something with sinus and cosinus but I can't figure out the correct formula. Maybe you can help me?


BladeRunner(Posted 2009) [#2]
atan(.6/.4) will return the angle for the above example.


_Skully(Posted 2009) [#3]
Ang=Atan2(x,y)


GfK(Posted 2009) [#4]
Ang=Atan2(x,y)
y,x.


plash(Posted 2009) [#5]
y,x



elcoo(Posted 2009) [#6]
Thanks all! Didn't even know about this command.