iDevGames Forums
Rotation Equation - Printable Version

+- iDevGames Forums (http://www.idevgames.com/forums)
+-- Forum: Development Zone (/forum-3.html)
+--- Forum: Game Programming Fundamentals (/forum-7.html)
+--- Thread: Rotation Equation (/thread-2139.html)



Rotation Equation - merrill541 - Nov 17, 2008 04:01 PM

Does anyone know of a general fast and simple 2D rotation equation in the form of where you input a point (x,y), it's axis (x2,y2) and the amount of rotation you want to be applied and it returns the new rotated point.


Rotation Equation - Najdorf - Nov 17, 2008 04:34 PM

Constructively (x3,y3)=(x2,y2)+cos(a)*(dx,dy)+(-dy,dx)*sin(a)

where a is the angle, dx=x-x2, dy=y-y2.