- Asked 2/25
- 2066 Magh (old course)
Midpoint circle: r=10, centre (50,50)
Short answer
Use midpoint circle algorithm from (0,10) with p0=-9; first-octant points are (0,10), (1,10), (2,10), (3,10), (4,9), (5,9), (6,8), (7,7). Adding center (50,50) gives (50,60), (51,60), (52,60), (53,60), (54,59), (55,59), (56,58), (57,57).
Calculate all the pixels of a circle with radius = 10 and center at (50, 50) in the first octant starting from (50, 60) proceeding to positive x axis direction.
Given: radius r = 10, centre (50,50). The first octant starts at (50,60), the top of the circle, and proceeds in the +x direction.
Start at (x0, y0) = (0, 10). Initial parameter p0 = 1 − r = -9.
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 | -9 | (0,10) | (1,10) |
| 1 | -6 | (1,10) | (2,10) |
| 2 | -1 | (2,10) | (3,10) |
| 3 | 6 | (3,10) | (4,9) |
| 4 | -3 | (4,9) | (5,9) |
| 5 | 8 | (5,9) | (6,8) |
| 6 | 5 | (6,8) | (7,7) |
| 7 | 6 | (7,7) | (8,6) |
Octant points about the origin: (0,10), (1,10), (2,10), (3,10), (4,9), (5,9), (6,8), (7,7).
Shift by (50,50) (add xc to x and yc to y):
| k | (x,y) in octant | plotted (x+xc, y+yc) |
|---|---|---|
| 0 | (0,10) | (50,60) |
| 1 | (1,10) | (51,60) |
| 2 | (2,10) | (52,60) |
| 3 | (3,10) | (53,60) |
| 4 | (4,9) | (54,59) |
| 5 | (5,9) | (55,59) |
| 6 | (6,8) | (56,58) |
| 7 | (7,7) | (57,57) |
Answer: first-octant pixels: (50,60), (51,60), (52,60), (53,60), (54,59), (55,59), (56,58), (57,57).
✓ Answer checked by Claude Opus 5.5 (high effort)
Related questions
- Midpoint circle: r=30, centre (10,20) · Computer Graphics, chapter 2 · asked 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×
- 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 (20,30) · Computer Graphics, chapter 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×