public void ellipse(double x,double y,double semiMajorAxis,double semiMinorAxis){
  if (semiMajorAxis < 0)   throw new IllegalArgumentException("ellipse semimajor axis can't be negative");
  if (semiMinorAxis < 0)   throw new IllegalArgumentException("ellipse semiminor axis can't be negative");
  double xs=scaleX(x);
  double ys=scaleY(y);
  double ws=factorX(2 * semiMajorAxis);
  double hs=factorY(2 * semiMinorAxis);
  if (ws <= 1 && hs <= 1)   pixel(x,y);
 else   offscreen.draw(new Ellipse2D.Double(xs - ws / 2,ys - hs / 2,ws,hs));
  draw();
}

public void ellipse ( double x , double y , double semiMajorAxis , double semiMinorAxis ) { if ( semiMajorAxis < 0 ) throw new IllegalArgumentException ( "ellipse semimajor axis can't be negative" ) ; if ( semiMinorAxis < 0 ) throw new IllegalArgumentException ( "ellipse semiminor axis can't be negative" ) ; double xs = scaleX ( x ) ; double ys = scaleY ( y ) ; double ws = factorX ( 2 * semiMajorAxis ) ; double hs = factorY ( 2 * semiMinorAxis ) ; if ( ws <= 1 && hs <= 1 ) pixel ( x , y ) ; else offscreen . draw ( new Ellipse2D . Double ( xs - ws / 2 , ys - hs / 2 , ws , hs ) ) ; draw ( ) ; }
draws an ellipse with given semimajor and semiminor axes , centered on ( x , y ) .
