src/main/java/org/teachingextensions/logo/utils/MazeUtils/StdDraw.java
public static void ellipse(double x, double y, double semiMajorAxis, double semiMinorAxis)
  {
    if (!(semiMajorAxis >= 0))
      throw new IllegalArgumentException("ellipse semimajor axis must be nonnegative");
    if (!(semiMinorAxis >= 0))
      throw new IllegalArgumentException("ellipse semiminor axis must be nonnegative");
    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 static void ellipse(double x, double y, double semiMajorAxis, double semiMinorAxis)
  {
    if (!(semiMajorAxis >= 0))
      throw new IllegalArgumentException("ellipse semimajor axis must be nonnegative");
    if (!(semiMinorAxis >= 0))
      throw new IllegalArgumentException("ellipse semiminor axis must be nonnegative");
    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 static void ellipse ( double x , double y , double semiMajorAxis , double semiMinorAxis ) { if ( ! ( semiMajorAxis >= 0 ) ) throw new IllegalArgumentException ( "ellipse semimajor axis must be nonnegative" ) ; if ( ! ( semiMinorAxis >= 0 ) ) throw new IllegalArgumentException ( "ellipse semiminor axis must be nonnegative" ) ; 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 the specified semimajor and semiminor axes,
centered at (<em>x</em>, <em>y</em>).

@param  x the <em>x</em>-coordinate of the center of the ellipse
@param  y the <em>y</em>-coordinate of the center of the ellipse
@param  semiMajorAxis is the semimajor axis of the ellipse
@param  semiMinorAxis is the semiminor axis of the ellipse
@throws IllegalArgumentException if either {@code semiMajorAxis}
or {@code semiMinorAxis} is negative
Draws an ellipse with the specified semimajor and semiminor axes centered at ( <em > x< / em > <em > y< / em > ) .