7,7c7,7 < * Copyright: © by the original author(s) and all contributors --- > * Copyright: � by the original author(s) and all contributors 205a206,206 > // cfm1 ******************************************************************* 209a211,218 > return angleToPoint(r, angle, new Point()); > } > > > /** > * Gets the point on a rectangle that corresponds to the given angle. > */ > static public Point angleToPoint(Rectangle r, double angle, Point p) { 218,218d226 < } 219,219c227,227 < else if (co >= 0.0) { --- > } else if (co >= 0.0) 221,221d228 < } 225,225d231 < } 226,226c232,232 < else if (si >= 0.0) { --- > } else if (si >= 0.0) 227a234,237 > > p.x = r.x + x; > p.y = r.y + y; > return p; 228,229d233 < } < return new Point(r.x + x, r.y + y); 235a244,250 > return polarToPoint(angle, fx, fy, new Point()); > } > > /** > * Converts a polar to a point > */ > static public Point polarToPoint(double angle, double fx, double fy, Point p) { 237a253,255 > p.x = (int)(fx*co+0.5); > p.y = (int)(fy*si+0.5); > return p; 238,238d252 < return new Point((int)(fx*co+0.5), (int)(fy*si+0.5)); 244a262,268 > return ovalAngleToPoint(r, angle, new Point()); > } > > /** > * Gets the point on an oval that corresponds to the given angle. > */ > static public Point ovalAngleToPoint(Rectangle r, double angle, Point p) { 245,245d261 < Point center = Geom.center(r); 246,246c269,269 < Point p = Geom.polarToPoint(angle, r.width/2, r.height/2); --- > p = Geom.polarToPoint(angle, r.width/2, r.height/2, p); 246a270,272 > p.x = r.x + r.width /2 + p.x; > p.y = r.y + r.height/2 + p.y; > return p; 247,247d269 < return new Point(center.x + p.x, center.y + p.y); 248a274,274 > // cfm1 *******************************************************************