Skip to main content

Midpoint ellipse: x²/64 + y²/36 = 1

Short answer

Using midpoint algorithm with rx=8, ry=6, region 1 from (0,6) to (6,4), region 2 to (8,0). First-quadrant pixels: (0,6), (1,6), (2,6), (3,6), (4,5), (5,5), (6,4), (7,3), (8,2), (8,1), (8,0).

Determine the pixel positions of the following curve in the first quadrant using the mid-point algorithm: x²/64 + y²/36 = 1.

The ellipse x²/64 + y²/36 = 1 has rx = 8, ry = 6 and centre at the origin (the curve is given in the first quadrant). Using the midpoint algorithm:

rx² = 64,  ry² = 36,  2rx² = 128,  2ry² = 72
Start (x0, y0) = (0, ry) = (0, 6)
p1_0 = ry² − rx²·ry + rx²/4 = 36 − 384 + 16 = −332
Region 1 while 2ry²x < 2rx²y.   Update (x → x+1):
  p1 < 0 :  p1 = p1 + 2ry²·x + ry²      (y same)
  p1 ≥ 0 :  y → y−1; p1 = p1 + 2ry²·x − 2rx²·y + ry²

Region 1

k(x_k, y_k)p1_k2ry²·x2rx²·y
0(0,6)-3320768
1(1,6)-22472768
2(2,6)-44144768
3(3,6)208216768
4(4,5)-108288640
5(5,5)288360640
6(6,4)244432512

At (7,3): 2ry²x = 504 ≥ 2rx²y = 384, so region 1 ends; (7,3) is the first point of region 2.

p2_0 = ry²(x+½)² + rx²(y−1)² − rx²ry²
     = 36(7.5)² + 64(2)² − 2304 = 2025 + 256 − 2304 = −23
Region 2 (y → y−1):
  p2 > 0 : x same;  p2 = p2 − 2rx²·y + rx²
  p2 ≤ 0 : x → x+1; p2 = p2 + 2ry²·x − 2rx²·y + rx²

Region 2

k(x_k, y_k)p2_k
0(7,3)-23
1(8,2)361
2(8,1)297
3(8,0)361

Answer: first-quadrant pixels: (0,6), (1,6), (2,6), (3,6), (4,5), (5,5), (6,4), (7,3), (8,2), (8,1), (8,0). The other quadrants follow by symmetry: (±x, ±y).

✓ Answer checked by Claude Opus 5.5 (high effort)

All Computer Graphics chapter 2 questions →