question: private static void drawCircleEndpoint ( Point from , Point to , Graphics g ) { final int diameter = 13 ; double a = to . x - from . x ; double b = from . y - to . y ; double theta = Math . atan2 ( b , a ) ; int xminus = ( int ) ( Math . cos ( theta ) * diameter / 2 ) ; int yplus = ( int ) ( Math . sin ( theta ) * diameter / 2 ) ; g . fillOval ( to . x - xminus - diameter / 2 , to . y + yplus - diameter / 2 , diameter , diameter ) ; Color c = g . getColor ( ) ; g . setColor ( Color . white ) ; g . fillOval ( to . x - xminus - diameter / 4 - 1 , to . y + yplus - diameter / 4 - 1 , ( int ) ( diameter / 1.4 ) , ( int ) ( diameter / 1.4 ) ) ; g . setColor ( c ) ; }
target:  Draws a circle endpoint at the 'to' point angled as if coming from the 'from' point.