Skip to main content

Midpoint circle: r=5, centre (10,5)

Short answer

Use midpoint circle algorithm with p0=1-r=-4; octant points are (0,5), (1,5), (2,5), (3,4). Applying eight-way symmetry about (10,5) yields 28 distinct pixels on the circle.

Calculate the points to draw a circle having radius 5 and center (10, 5) using the midpoint circle algorithm.

Given: radius r = 5, centre (10,5).

Start at (x0, y0) = (0, 5). Initial parameter p0 = 1 − r = -4.

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-4(0,5)(1,5)
1-1(1,5)(2,5)
24(2,5)(3,4)
33(3,4)(4,3)

Octant points about the origin: (0,5), (1,5), (2,5), (3,4).

Eight-way symmetry gives, for each octant point (x,y), the points (xc±x, yc±y) and (xc±y, yc±x):

(x,y)8 symmetric points
(0,5)(10,10) (10,10) (10,0) (10,0) (15,5) (5,5) (15,5) (5,5)
(1,5)(11,10) (9,10) (11,0) (9,0) (15,6) (5,6) (15,4) (5,4)
(2,5)(12,10) (8,10) (12,0) (8,0) (15,7) (5,7) (15,3) (5,3)
(3,4)(13,9) (7,9) (13,1) (7,1) (14,8) (6,8) (14,2) (6,2)

Answer: 28 distinct pixels on the whole circle, listed above.

✓ Answer checked by Claude Opus 5.5 (high effort)

All Computer Graphics chapter 2 questions →