question: public static double calcRotationAngleInDegrees ( PointF centerPt , PointF targetPt ) { double theta = Math . atan2 ( targetPt . y - centerPt . y , targetPt . x - centerPt . x ) ; double angle = Math . toDegrees ( theta ) ; if ( angle < 0 ) { angle += 360 ; } return angle ; }
target:  Calculates the angle from centerPt to targetPt in degrees. The return should range from [0,360), rotating CLOCKWISE, 0 and 360 degrees represents EAST, 90 degrees represents SOUTH, etc... <p/> Assumes all points are in the same coordinate space.  If they are not, you will need to call SwingUtilities.convertPointToScreen or equivalent on all arguments before passing them  to this function.