First you need to get the mouse's position. Then you need to know the
position vector of the sprite. Then you need to rotate the sprite
until its axis aligned with the where the mouse is. You can use the
sin function to orient the position vector of the sprite in a way that its
axis aligned with the mouses position.
As you can see you will also have to calculate the line from x = 0
to x = MAX where the line needs to intersect the sprite position.
Then you will have to do the same for the mouse point. And lastly
you need to rotate the mouse until its line is very similar to that of the
Another way is to determine the angle of a line from the center of the screen to your mouse, then rotate your image that much. Don't forget to check the mouse position constantly, either using a timer (like every x seconds) or every time the mouse moves.
Actually you can also use Pythagorean. Make a right trials with the end point from the center of the sprite and the mouse clicked point, then
all you have to do is rotate the sprite by using the sin function until the
y component of the right triangle goes to 0.