Skip to main content

Process of drawing an ellipse

Short answer

Shift ellipse to origin, compute first quadrant only. Split at slope = -1 into region 1 (2ry²x<2rx²y, step x, test midpoint with p1) and region 2 (step y, test with p2). Decision parameters select the closest pixel, then apply four-way symmetry and add center coordinates to complete the ellipse.

Explain the process of drawing an ellipse in raster graphics.

An ellipse with centre (xc, yc) and semi-axes rx and ry has the equation (x−xc)²/rx² + (y−yc)²/ry² = 1. In a raster system, it is drawn by scan conversion, using the midpoint ellipse algorithm (the direct equation and polar methods need square roots or trigonometry and are slower).

Steps

  1. Use symmetry. Shift the ellipse to the origin and compute only the first quadrant; each point (x, y) gives (±x, ±y), then add the centre (xc, yc).
  2. Split the quadrant into two regions where the tangent slope is −1: region 1 where 2ry²x < 2rx²y, region 2 elsewhere.
  3. Region 1: start at (0, ry). Step x by 1, and use the decision parameter p1 = ry² − rx²ry + ¼rx² to choose between y and y − 1.
  4. Region 2: start from the last point of region 1. Step y by −1 and use p2 = ry²(x+½)² + rx²(y−1)² − rx²ry² to choose between x and x + 1, until y = 0.
  5. Plot the four symmetric points at each step.
        y
        |   region 1  (x steps)
   ry --*--*--*
        |       *
        |         *   <- slope = −1
        |           *
        |  region 2  *  (y steps)
        +-------------*---- x
                      rx

✓ Answer checked by Claude Opus 5.5 (high effort)

All Computer Graphics chapter 2 questions →