Skip to main content

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):

kp_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)
36(3,10)(4,9)
4-3(4,9)(5,9)
58(5,9)(6,8)
65(6,8)(7,7)
76(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 octantplotted (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)

All Computer Graphics chapter 2 questions →