7c7 < * Copyright: © by the original author(s) and all contributors --- > * Copyright: � by the original author(s) and all contributors 205a206 > // 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,219c227 < } < else if (co >= 0.0) { --- > } else if (co >= 0.0) 221d228 < } 225,226c232 < } < else if (si >= 0.0) { --- > } else if (si >= 0.0) 228,229c234,237 < } < return new Point(r.x + x, r.y + y); --- > > p.x = r.x + x; > p.y = r.y + y; > return p; 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) { 238c253,255 < return new Point((int)(fx*co+0.5), (int)(fy*si+0.5)); --- > p.x = (int)(fx*co+0.5); > p.y = (int)(fy*si+0.5); > return p; 245,247c262,272 < Point center = Geom.center(r); < Point p = Geom.polarToPoint(angle, r.width/2, r.height/2); < return new Point(center.x + p.x, center.y + p.y); --- > 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) { > p = Geom.polarToPoint(angle, r.width/2, r.height/2, p); > p.x = r.x + r.width /2 + p.x; > p.y = r.y + r.height/2 + p.y; > return p; 248a274 > // cfm1 *******************************************************************