public void arc(double x,double y,double r,double angle1,double angle2){
  if (r < 0)   throw new IllegalArgumentException("arc radius can't be negative");
  while (angle2 < angle1)   angle2+=360;
  double xs=scaleX(x);
  double ys=scaleY(y);
  double ws=factorX(2 * r);
  double hs=factorY(2 * r);
  if (ws <= 1 && hs <= 1)   pixel(x,y);
 else   offscreen.draw(new Arc2D.Double(xs - ws / 2,ys - hs / 2,ws,hs,angle1,angle2 - angle1,Arc2D.OPEN));
  draw();
}

public void arc ( double x , double y , double r , double angle1 , double angle2 ) { if ( r < 0 ) throw new IllegalArgumentException ( "arc radius can't be negative" ) ; while ( angle2 < angle1 ) angle2 += 360 ; double xs = scaleX ( x ) ; double ys = scaleY ( y ) ; double ws = factorX ( 2 * r ) ; double hs = factorY ( 2 * r ) ; if ( ws <= 1 && hs <= 1 ) pixel ( x , y ) ; else offscreen . draw ( new Arc2D . Double ( xs - ws / 2 , ys - hs / 2 , ws , hs , angle1 , angle2 - angle1 , Arc2D . OPEN ) ) ; draw ( ) ; }
draws an arc of radius r , centered on ( x , y ) , from angle1 to angle2 ( in degrees ) .
