I made a thing called AngleTools.js.
It is used to calculate angles and movements with x,y coordinates
Calculate the angle between two objects in degrees. Both objects need to have x and y properties.
Calculate the distance between two objects in a straight line in pixels. Both objects need to have x and y properties.
Calculate the x and y changes needed to move an object a certain distance along a certain angle.