public Polygon createArcPolygon(double startAng,double angExtent){
  Envelope env=dim.getEnvelope();
  double xRadius=env.getWidth() / 2.0;
  double yRadius=env.getHeight() / 2.0;
  double centreX=env.getMinX() + xRadius;
  double centreY=env.getMinY() + yRadius;
  double angSize=angExtent;
  if (angSize <= 0.0 || angSize > 2 * Math.PI)   angSize=2 * Math.PI;
  double angInc=angSize / (nPts - 1);
  Coordinate[] pts=new Coordinate[nPts + 2];
  int iPt=0;
  pts[iPt++]=coord(centreX,centreY);
  for (int i=0; i < nPts; i++) {
    double ang=startAng + angInc * i;
    double x=xRadius * Math.cos(ang) + centreX;
    double y=yRadius * Math.sin(ang) + centreY;
    pts[iPt++]=coord(x,y);
  }
  pts[iPt++]=coord(centreX,centreY);
  LinearRing ring=geomFact.createLinearRing(pts);
  Polygon poly=geomFact.createPolygon(ring,null);
  return (Polygon)rotate(poly);
}

public Polygon createArcPolygon ( double startAng , double angExtent ) { Envelope env = dim . getEnvelope ( ) ; double xRadius = env . getWidth ( ) / 2.0 ; double yRadius = env . getHeight ( ) / 2.0 ; double centreX = env . getMinX ( ) + xRadius ; double centreY = env . getMinY ( ) + yRadius ; double angSize = angExtent ; if ( angSize <= 0.0 || angSize > 2 * Math . PI ) angSize = 2 * Math . PI ; double angInc = angSize / ( nPts - 1 ) ; Coordinate [ ] pts = new Coordinate [ nPts + 2 ] ; int iPt = 0 ; pts [ iPt ++ ] = coord ( centreX , centreY ) ; for ( int i = 0 ; i < nPts ; i ++ ) { double ang = startAng + angInc * i ; double x = xRadius * Math . cos ( ang ) + centreX ; double y = yRadius * Math . sin ( ang ) + centreY ; pts [ iPt ++ ] = coord ( x , y ) ; } pts [ iPt ++ ] = coord ( centreX , centreY ) ; LinearRing ring = geomFact . createLinearRing ( pts ) ; Polygon poly = geomFact . createPolygon ( ring , null ) ; return ( Polygon ) rotate ( poly ) ; }
creates an elliptical arc polygon . the polygon is formed from the specified arc of an ellipse and the two radii connecting the endpoints to the centre of the ellipse .
