- Asked 2/25
- 2068 Bhadra (old course) · 10 marks
Midpoint circle: r=30, centre (10,20)
Short answer
Using midpoint circle algorithm with p0=-29, start at (0,30) relative to center, stop when x≥y, then shift by (10,20). First-octant pixels: (10,50), (11,50), (12,50), (13,50), (14,50), (15,50), (16,49), (17,49), (18,49), (19,49), (20,48), (21,48), (22,47), (23,47), (24,47), (25,46), (26,45), (27,45), (28,44), (29,43), (30,42), (31,41).
Calculate all pixels of a circle in the first octant, proceeding in positive X axis direction. The radius = 30 and center at (10, 20).
Given: radius r = 30, centre (10,20).
Start at (x0, y0) = (0, 30). Initial parameter p0 = 1 − r = -29.
p < 0 : next point (x+1, y), p_new = p + 2x_new + 1
p ≥ 0 : next point (x+1, y−1), p_new = p + 2(x_new − y_new) + 1
Stop when x ≥ y
Decision parameter table (circle centred at the origin; p_k decides the next point):
| k | p_k | (x_k, y_k) | next (x, y) |
|---|---|---|---|
| 0 | -29 | (0,30) | (1,30) |
| 1 | -26 | (1,30) | (2,30) |
| 2 | -21 | (2,30) | (3,30) |
| 3 | -14 | (3,30) | (4,30) |
| 4 | -5 | (4,30) | (5,30) |
| 5 | 6 | (5,30) | (6,29) |
| 6 | -39 | (6,29) | (7,29) |
| 7 | -24 | (7,29) | (8,29) |
| 8 | -7 | (8,29) | (9,29) |
| 9 | 12 | (9,29) | (10,28) |
| 10 | -23 | (10,28) | (11,28) |
| 11 | 0 | (11,28) | (12,27) |
| 12 | -29 | (12,27) | (13,27) |
| 13 | -2 | (13,27) | (14,27) |
| 14 | 27 | (14,27) | (15,26) |
| 15 | 6 | (15,26) | (16,25) |
| 16 | -11 | (16,25) | (17,25) |
| 17 | 24 | (17,25) | (18,24) |
| 18 | 13 | (18,24) | (19,23) |
| 19 | 6 | (19,23) | (20,22) |
| 20 | 3 | (20,22) | (21,21) |
| 21 | 4 | (21,21) | (22,20) |
Octant points about the origin: (0,30), (1,30), (2,30), (3,30), (4,30), (5,30), (6,29), (7,29), (8,29), (9,29), (10,28), (11,28), (12,27), (13,27), (14,27), (15,26), (16,25), (17,25), (18,24), (19,23), (20,22), (21,21).
Shift by (10,20) (add xc to x and yc to y):
| k | (x,y) in octant | plotted (x+xc, y+yc) |
|---|---|---|
| 0 | (0,30) | (10,50) |
| 1 | (1,30) | (11,50) |
| 2 | (2,30) | (12,50) |
| 3 | (3,30) | (13,50) |
| 4 | (4,30) | (14,50) |
| 5 | (5,30) | (15,50) |
| 6 | (6,29) | (16,49) |
| 7 | (7,29) | (17,49) |
| 8 | (8,29) | (18,49) |
| 9 | (9,29) | (19,49) |
| 10 | (10,28) | (20,48) |
| 11 | (11,28) | (21,48) |
| 12 | (12,27) | (22,47) |
| 13 | (13,27) | (23,47) |
| 14 | (14,27) | (24,47) |
| 15 | (15,26) | (25,46) |
| 16 | (16,25) | (26,45) |
| 17 | (17,25) | (27,45) |
| 18 | (18,24) | (28,44) |
| 19 | (19,23) | (29,43) |
| 20 | (20,22) | (30,42) |
| 21 | (21,21) | (31,41) |
Answer: first-octant pixels: (10,50), (11,50), (12,50), (13,50), (14,50), (15,50), (16,49), (17,49), (18,49), (19,49), (20,48), (21,48), (22,47), (23,47), (24,47), (25,46), (26,45), (27,45), (28,44), (29,43), (30,42), (31,41).
✓ Answer checked by Claude Opus 5.5 (high effort)
Related questions
- Midpoint circle: r=10, centre (50,50) · Computer Graphics, chapter 2 · asked 2×
- Midpoint circle: r=10, centre (20,30) · Computer Graphics, chapter 2
- Midpoint circle: r=6, centre (20,10) · Computer Graphics, chapter 2 · asked 2×
- Midpoint circle: r=8, centre (10,10) · Computer Graphics, chapter 2 · asked 2×
- 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=7, centre (10,15) · Computer Graphics, chapter 2
- Centre and radius of a circle on sphere · Mathematics, chapter 3 · asked 3×
- Centre and radius of circle of sphere section · Mathematics, chapter 3 · asked 3×
- Dirichlet integral over positive octant region · Mathematics, chapter 2 · asked 3×