---
title: "Midpoint circle: r=30, centre (10,20)"
subject: "Computer Graphics"
chapter: 2
key: "semester_5/computer_graphics:circle-r30-center-10-20-octant"
source: https://www.bctengineer.com/q/semester_5/computer_graphics/circle-r30-center-10-20-octant
site: BCT Engineering
---

# Midpoint circle: r=30, centre (10,20)

Computer Graphics · Chapter 2: Scan-Conversion

- Asked in: 2068 Bhadra (old course), 10 marks
- Video: [Problem Based on Drawing Circle having at (2,2) using Bresenham's midpoint algorithm](https://www.youtube.com/watch?v=PuPuEQP-nFI) — Ekeeda
- Answer checked by Claude Opus 5.5 (high effort) on 2026-10-14
- Page: https://www.bctengineer.com/q/semester_5/computer_graphics/circle-r30-center-10-20-octant
- Whole chapter: https://www.bctengineer.com/md/semester_5/computer_graphics/chapter-2

## Question

Calculate all pixels of a circle in the first octant, proceeding in positive X axis direction. The radius = 30 and center at (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).

## Answer

**Given:** radius r = 30, centre (10,20). 

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

```text
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).**

## Check yourself

The answer's key points as multiple-choice questions, with the correct option and why.

1. For r = 30, p0 equals:
   A. 29
   B. −30
   C. −29
   D. −31
   Answer: C. 1 − 30 = −29. (Key point: Initial parameter)

2. At (5,30), p = 6. Next point (6,29) gives new p of:
   A. −39 (6 + 2(6−29) + 1)
   B. 13
   C. −29
   D. −9
   Answer: A. p_new = p + 2(x_new − y_new) + 1 = 6 − 46 + 1 = −39. (Key point: Update with y decrement)

3. The octant point (0,30) with centre (10,20) is plotted at:
   A. (30,20)
   B. (10,50)
   C. (20,50)
   D. (10,30)
   Answer: B. (10+0, 20+30) = (10,50). (Key point: Shifting)

4. The octant calculation stops at (21,21) because:
   A. p is zero there
   B. x equals the radius
   C. y has become zero
   D. x has reached y (x ≥ y), so the first octant is complete
   Answer: D. The loop runs while x < y. (Key point: End of octant)

## Close variants set in other exams

- [Midpoint circle: r=10, centre (50,50)](https://www.bctengineer.com/question.md?key=semester_5%2Fcomputer_graphics%3Acircle-r10-center-50-50-octant) — Computer Graphics, chapter 2, asked 2×

## Related in Computer Graphics

- [Midpoint circle: r=10, centre (20,30)](https://www.bctengineer.com/question.md?key=semester_5%2Fcomputer_graphics%3Acircle-r10-center-20-30) — Computer Graphics, chapter 2
- [Midpoint circle: r=6, centre (20,10)](https://www.bctengineer.com/question.md?key=semester_5%2Fcomputer_graphics%3Acircle-r6-center-20-10) — Computer Graphics, chapter 2, asked 2×
- [Midpoint circle: r=8, centre (10,10)](https://www.bctengineer.com/question.md?key=semester_5%2Fcomputer_graphics%3Acircle-r8-center-10-10) — Computer Graphics, chapter 2, asked 2×
- [Midpoint circle: r=5, centre (10,5)](https://www.bctengineer.com/question.md?key=semester_5%2Fcomputer_graphics%3Acircle-r5-center-10-5) — Computer Graphics, chapter 2, asked 2×
- [Midpoint circle: r=8, centre (-5,10)](https://www.bctengineer.com/question.md?key=semester_5%2Fcomputer_graphics%3Acircle-r8-center-neg5-10) — Computer Graphics, chapter 2, asked 2×
- [Midpoint circle: r=7, centre (10,15)](https://www.bctengineer.com/question.md?key=semester_5%2Fcomputer_graphics%3Acircle-r7-center-10-15) — Computer Graphics, chapter 2

## Related in other subjects

- [Centre and radius of a circle on sphere](https://www.bctengineer.com/question.md?key=semester_2%2Fmathematics%3Acentre-radius-circle-sphere) — Mathematics, chapter 3, asked 3×
- [Centre and radius of circle of sphere section](https://www.bctengineer.com/question.md?key=semester_2%2Fmathematics%3Acentre-radius-circle-sphere-section) — Mathematics, chapter 3, asked 3×
- [Dirichlet integral over positive octant region](https://www.bctengineer.com/question.md?key=semester_2%2Fmathematics%3Adirichlet-integral-over-positive-octant) — Mathematics, chapter 2, asked 3×
