Rotating A Sprite Towards An Object In XNA  July 14, 2008  Often
when creating games in 2D you need a sprite to rotate towards
another object, whether that be a turret rotating towards an
enemy or making something follow your mouse. Regardless of the
use of this rotation the principle is the same. In this tutorial
I use the basic concept of making something follow the mouse,
but the game logic provided should enable you to rotate any
sprite towards just about any object on the game screen.  Before
we start anything language specific, we should have a think
about what exact we want to achieve. We’re going to assume we
start with the sprite unrotated, parallel to the X and Y axis
(this assumption is just for ease of explanation and doesn’t
factor into any calculations). So we begin say, with a sqaure:
With the center of rotation at the middle of the square. In
order to rotate this towards distant point we need to do some
basic trigonometry. I know this seems scary but it’s really easy
as pie, any 15 year old