OK, firstly, an apology, because I know that this question was asked earlier than once. However, even after considering other questions and answers, I could not get this to work for my situation. The following is an example: 
All I'm just trying to work out is the angle between P1 and P2, assuming 0 degrees as shown above so that I can direct the arrow between the two in the right direction. So I am doing something like this ...
Point p1 = new Point(200,300); Point p2 = new Point(300,200); double difX = p2.x - p1.x; double difY = p2.y - p1.y; double rotAng = Math.toDegrees(Math.atan2(difY,difX));
What happens: -45, where should there be 45? However, this is not just a case, I do not think that it returns a negative result, for example, if I changed P1 to 300 300 (below P2), then the angle should be 0, but it returns as -90.
So I'm just wondering if anyone can point out what I'm doing wrong to figure this out, or is it possible to do so?
source share