public int currentSegment(float[] coords) { if (current > limit) { throw new NoSuchElementException("arc iterator out of bounds"); } if (current == 0) { coords[0] = (float) (Math.cos(startAngRad) * w + x) / 2; coords[1] = (float) (Math.sin(startAngRad) * h + y) / 2; if (xform != null) { xform.transform(coords, 0, coords, 0, 1); } return SEG_MOVETO; } if (type != OPEN && current == limit) { return SEG_CLOSE; } if (type == PIE && current == limit - 1) { coords[0] = (float) (x + w / 2); coords[1] = (float) (y + h / 2); if (xform != null) { xform.transform(coords, 0, coords, 0, 1); } return SEG_LINETO; }   double angle = startAngRad; angle += increment * (current - 1); double relx = Math.cos(angle); double rely = Math.sin(angle); double z = btan(increment); coords[0] = (float) (x + (relx - z * rely) * w); coords[1] = (float) (y + (rely + z * relx) * h); angle += increment; relx = Math.cos(angle); rely = Math.sin(angle); coords[2] = (float) (x + (relx + z * rely) * w); coords[3] = (float) (y + (rely - z * relx) * h); coords[4] = (float) (x + relx * w); coords[5] = (float) (y + rely * h); if (xform != null) { xform.transform(coords, 0, coords, 0, 3); } return SEG_CUBICTO;
public int currentSegment(float[] coords) { double[] double_coords = new double[6]; int code = currentSegment (double_coords); for (int i = 0; i < 6; ++i) coords[i] = (float) double_coords[i]; return code;
		public int currentSegment(float[] coords) {			if (current > limit) {				throw new NoSuchElementException("arc iterator out of bounds");			}			if (current == 0) {				coords[0] = (float) (Math.cos(startAngRad) * w + x) / 2;				coords[1] = (float) (Math.sin(startAngRad) * h + y) / 2;				if (xform != null) {					xform.transform(coords, 0, coords, 0, 1);				}				return SEG_MOVETO;			}			if (type != OPEN && current == limit) {				return SEG_CLOSE;			}			if (type == PIE && current == limit - 1) {				coords[0] = (float) (x + w / 2);				coords[1] = (float) (y + h / 2);				if (xform != null) {					xform.transform(coords, 0, coords, 0, 1);				}				return SEG_LINETO;			}			// XXX Fill coords with 2 control points and next quarter point			double angle = startAngRad;			angle += increment * (current - 1);			double relx = Math.cos(angle);			double rely = Math.sin(angle);			double z = btan(increment);			coords[0] = (float) (x + (relx - z * rely) * w);			coords[1] = (float) (y + (rely + z * relx) * h);			angle += increment;			relx = Math.cos(angle);			rely = Math.sin(angle);			coords[2] = (float) (x + (relx + z * rely) * w);			coords[3] = (float) (y + (rely - z * relx) * h);			coords[4] = (float) (x + relx * w);			coords[5] = (float) (y + rely * h);			if (xform != null) {				xform.transform(coords, 0, coords, 0, 3);			}			return SEG_CUBICTO;		}