Hi, I googled it and came up with this. I don't understand it but maybe its some help to you?
angleInRadians = Math.atan2 (y, x);
angleInDegrees = angleInRadians * 180 / Math.PI;
This is the basic process of turning x and y coordinates into an angle.