if (current > limit) throw new NoSuchElementException("arc iterator out of bounds"); if (current == 0) { coords[0] = (float) (Math.cos(start) * w + x) / 2; coords[1] = (float) (Math.sin(start) * 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; }  coords[0] = (float) 0; coords[1] = (float) 0; coords[2] = (float) 0; coords[3] = (float) 0; coords[4] = (float) 0; coords[5] = (float) 0; if (xform != null) xform.transform(coords, 0, coords, 0, 3); return SEG_CUBICTO;
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(start) * w + x) / 2;          coords[1] = (float) (Math.sin(start) * 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      coords[0] = (float) 0;      coords[1] = (float) 0;      coords[2] = (float) 0;      coords[3] = (float) 0;      coords[4] = (float) 0;      coords[5] = (float) 0;      if (xform != null)        xform.transform(coords, 0, coords, 0, 3);      return SEG_CUBICTO;    }