x1 = ((x1 * 2) - mx) / mw; y1 = ((y1 * 2) - my) / mh; x2 = ((x2 * 2) - mx) / mw; y2 = ((y2 * 2) - my) / mh; double start = Math.atan2(y1, x1) * (-180 / Math.PI); double extent = Math.atan2(y2, x2) * (-180 / Math.PI) - start;
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;
	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 * 2) - mx) / mw;		y1 = ((y1 * 2) - my) / mh;		x2 = ((x2 * 2) - mx) / mw;		y2 = ((y2 * 2) - my) / mh;		double start = Math.atan2(y1, x1) * (-180 / Math.PI);		double extent = Math.atan2(y2, x2) * (-180 / Math.PI) - start;		if (extent < 0)			extent += 360;		setAngleStart(start);		setAngleExtent(extent);	}