I'm building a html5 canvas game and I need a way to get my sprite to face the mouse cursor. I have the X and Y co-ordinates for the sprite, and also the X and Y co-ordinates of the pointer. All I'm stuck with is the math involved to make the sprite face the pointer. It's all in a 2D world, so I can't imagine it'll be too complicated, but I have very little experience with this stuff.
To add, i should note that I need an angle in degrees that will point me towards the cursor using its X and Y position.
How can i know the co-ordinates of the cursor and where do i put all of this stuff ?