- 2076 Chaitra · 8 marks
Digitize ellipse Rx=12, Ry=7
Short answer
With rx=12, ry=7, center (19,10), using midpoint algorithm: region 1 from (0,7) to (10,4), region 2 to (12,0). Shifted points: (19,17), (20,17), (21,17), (22,17), (23,17), (24,16), (25,16), (26,16), (27,15), (28,15), (29,14), (30,13), (30,12), (31,11), (31,10).
Digitize the ellipse with radius Rx = 12 and Ry = 7 and center (19, 10).
Given: rx = 12, ry = 7, centre (19,10). Compute the first quadrant about the origin, then use 4-way symmetry and shift by the centre.
rx² = 144, ry² = 49, 2rx² = 288, 2ry² = 98
Start (0, 7)
p1_0 = ry² − rx²·ry + rx²/4 = 49 − 1008 + 36 = −923
Region 1 (while 2ry²x < 2rx²y):
p1 < 0 : p1 += 2ry²·x_new + ry² (y same)
p1 ≥ 0 : y−−; p1 += 2ry²·x_new − 2rx²·y_new + ry²
Region 1
| k | (x_k, y_k) | p1_k | 2ry²·x | 2rx²·y |
|---|---|---|---|---|
| 0 | (0,7) | -923 | 0 | 2016 |
| 1 | (1,7) | -776 | 98 | 2016 |
| 2 | (2,7) | -531 | 196 | 2016 |
| 3 | (3,7) | -188 | 294 | 2016 |
| 4 | (4,7) | 253 | 392 | 2016 |
| 5 | (5,6) | -936 | 490 | 1728 |
| 6 | (6,6) | -299 | 588 | 1728 |
| 7 | (7,6) | 436 | 686 | 1728 |
| 8 | (8,5) | -171 | 784 | 1440 |
| 9 | (9,5) | 760 | 882 | 1440 |
| 10 | (10,4) | 637 | 980 | 1152 |
At (11,3): 2ry²x = 1078 ≥ 2rx²y = 864, so region 2 starts at (11,3).
p2_0 = 49(11.5)² + 144(2)² − 144·49 = 6480.25 + 576 − 7056 = 0.25
Region 2: p2 > 0 : x same, p2 += rx² − 2rx²·y_new
p2 ≤ 0 : x++, p2 += 2ry²·x_new − 2rx²·y_new + rx²
Region 2
| k | (x_k, y_k) | p2_k |
|---|---|---|
| 0 | (11,3) | 0.25 |
| 1 | (11,2) | -431.75 |
| 2 | (12,1) | 600.25 |
| 3 | (12,0) | 744.25 |
First-quadrant points about the origin: (0,7), (1,7), (2,7), (3,7), (4,7), (5,6), (6,6), (7,6), (8,5), (9,5), (10,4), (11,3), (11,2), (12,1), (12,0).
Adding the centre (19,10) to (x, y) gives the first quadrant pixels:
(19,17), (20,17), (21,17), (22,17), (23,17), (24,16), (25,16), (26,16), (27,15), (28,15), (29,14), (30,13), (30,12), (31,11), (31,10)
The other three quadrants are (19−x, 10+y), (19+x, 10−y), (19−x, 10−y) for each point above.
✓ Answer checked by Claude Opus 5.5 (high effort)
Related questions
- Midpoint circle: r=5, centre (10,5) · Computer Graphics, chapter 2 · asked 2×
- Midpoint circle: r=8, centre (-5,10) · Computer Graphics, chapter 2 · asked 2×
- Midpoint circle: r=10, centre (50,50) · Computer Graphics, chapter 2 · asked 2×
- Midpoint circle: r=30, centre (10,20) · Computer Graphics, chapter 2 · asked 2×
- Midpoint circle: r=10, centre (20,30) · Computer Graphics, chapter 2
- Bresenham: line (20,10) to (30,18) · Computer Graphics, chapter 2 · asked 4×
- Standard error; population 12,19,13,16 · Probability and Statistics, chapter 4
- Q and center frequency; realize −2000/(s²+500s+10⁶) · Filter Design, chapter 6
- K-map Σ(1,2,3,8,9,10,11,14)+d(0,4,12), NAND · Digital Logic, chapter 3 · asked 5×
- K-map Σ(0,1,4,8,10,11,12)+d, NOR · Digital Logic, chapter 3 · asked 5×