double start = Math.toDegrees(Math.atan2(y1, x1)); double extent = Math.toDegrees(Math.atan2(y2, x2)) - start;
double start = Math.toDegrees(Math.atan2(-y1, x1)); double extent = Math.toDegrees(Math.atan2(-y2, x2)) - start;
  public void setAngles(double x1, double y1, double x2, double y2)  {		// Normalize the points.		double mx = getX();		double my = getY();		double mw = getWidth();		double mh = getHeight();    x1 = x1 - (mx + mw / 2);    y1 = y1 - (my + mh / 2);    x2 = x2 - (mx + mw / 2);    y2 = y2 - (my + mh / 2);    double start = Math.toDegrees(Math.atan2(y1, x1));    double extent = Math.toDegrees(Math.atan2(y2, x2)) - start;		if (extent < 0)			extent += 360;		setAngleStart(start);		setAngleExtent(extent);	}