- 2076 Asoj · 6 marks
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_k | 2ry²·x | 2rx²·y |
|---|---|---|---|---|
| 0 | (0,6) | -332 | 0 | 768 |
| 1 | (1,6) | -224 | 72 | 768 |
| 2 | (2,6) | -44 | 144 | 768 |
| 3 | (3,6) | 208 | 216 | 768 |
| 4 | (4,5) | -108 | 288 | 640 |
| 5 | (5,5) | 288 | 360 | 640 |
| 6 | (6,4) | 244 | 432 | 512 |
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)
Related questions
- Compare DDA/Bresenham; midpoint ellipse · Computer Graphics, chapter 2
- Second region condition, ellipse midpoint · Computer Graphics, chapter 2
- Midpoint circle algorithm and decision parameter · Computer Graphics, chapter 2 · asked 8×
- Ellipse symmetry and drawing algorithm · Computer Graphics, chapter 2
- Midpoint circle: r=8, centre (10,10) · Computer Graphics, chapter 2 · asked 2×
- Midpoint circle: r=6, centre (20,10) · Computer Graphics, chapter 2 · asked 2×
- Double integral xy over ellipse in first quadrant · Mathematics, chapter 2 · asked 3×
- Curve R=300 m, deflection 36°, with checks · Surveying II, chapter 6
- Floating point division algorithm · Computer Organization and Architecture, chapter 5 · asked 4×
- 150 km line with mid-point shunt capacitor · Power System Analysis I, chapter 6