public int currentSegment(float[] coords){
  if (isDone()) {
    throw new NoSuchElementException("arc iterator out of bounds");
  }
  double angle=angStRad;
  if (index == 0) {
    coords[0]=(float)(x + Math.cos(angle) * w);
    coords[1]=(float)(y + Math.sin(angle) * h);
    if (affine != null) {
      affine.transform(coords,0,coords,0,1);
    }
    return SEG_MOVETO;
  }
  if (index > arcSegs) {
    if (index == arcSegs + lineSegs) {
      return SEG_CLOSE;
    }
    coords[0]=(float)x;
    coords[1]=(float)y;
    if (affine != null) {
      affine.transform(coords,0,coords,0,1);
    }
    return SEG_LINETO;
  }
  angle+=increment * (index - 1);
  double relx=Math.cos(angle);
  double rely=Math.sin(angle);
  coords[0]=(float)(x + (relx - cv * rely) * w);
  coords[1]=(float)(y + (rely + cv * relx) * h);
  angle+=increment;
  relx=Math.cos(angle);
  rely=Math.sin(angle);
  coords[2]=(float)(x + (relx + cv * rely) * w);
  coords[3]=(float)(y + (rely - cv * relx) * h);
  coords[4]=(float)(x + relx * w);
  coords[5]=(float)(y + rely * h);
  if (affine != null) {
    affine.transform(coords,0,coords,0,3);
  }
  return SEG_CUBICTO;
}

public int currentSegment ( float [ ] coords ) { if ( isDone ( ) ) { throw new NoSuchElementException ( "arc iterator out of bounds" ) ; } double angle = angStRad ; if ( index == 0 ) { coords [ 0 ] = ( float ) ( x + Math . cos ( angle ) * w ) ; coords [ 1 ] = ( float ) ( y + Math . sin ( angle ) * h ) ; if ( affine != null ) { affine . transform ( coords , 0 , coords , 0 , 1 ) ; } return SEG_MOVETO ; } if ( index > arcSegs ) { if ( index == arcSegs + lineSegs ) { return SEG_CLOSE ; } coords [ 0 ] = ( float ) x ; coords [ 1 ] = ( float ) y ; if ( affine != null ) { affine . transform ( coords , 0 , coords , 0 , 1 ) ; } return SEG_LINETO ; } angle += increment * ( index - 1 ) ; double relx = Math . cos ( angle ) ; double rely = Math . sin ( angle ) ; coords [ 0 ] = ( float ) ( x + ( relx - cv * rely ) * w ) ; coords [ 1 ] = ( float ) ( y + ( rely + cv * relx ) * h ) ; angle += increment ; relx = Math . cos ( angle ) ; rely = Math . sin ( angle ) ; coords [ 2 ] = ( float ) ( x + ( relx + cv * rely ) * w ) ; coords [ 3 ] = ( float ) ( y + ( rely - cv * relx ) * h ) ; coords [ 4 ] = ( float ) ( x + relx * w ) ; coords [ 5 ] = ( float ) ( y + rely * h ) ; if ( affine != null ) { affine . transform ( coords , 0 , coords , 0 , 3 ) ; } return SEG_CUBICTO ; }
returns the coordinates and type of the current path segment in the iteration . the return value is the path segment type : seg_moveto , seg_lineto , seg_quadto , seg_cubicto , or seg_close . a float array of length 6 must be passed in and may be used to store the coordinates of the point ( s ) . each point is stored as a pair of float x , y coordinates . seg_moveto and seg_lineto types will return one point , seg_quadto will return two points , seg_cubicto will return 3 points and seg_close will not return any points .
