Below are the few steps given for scan-converting a circle using Bresenham’s…
2017
Below are the few steps given for scan-converting a circle using Bresenham’s Algorithm. Which of the given steps is not correct ?
- A.
Compute 𝑑 = 3 − 2𝑟 (where 𝑟 is radius)
- B.
Stop if 𝑥 > 𝑦
- C.
If 𝑑 < 0, then 𝑑 = 4𝑥 + 6 and 𝑥 = 𝑥 + 1
- D.
If 𝑑 ≥ 0, then 𝑑 = 4 ∗ (𝑥 − 𝑦) + 10,𝑥 = 𝑥 + 1 and 𝑦 = 𝑦 + 1
Attempted by 108 students.
Show answer & explanation
Correct answer: D
Correct Bresenham (midpoint) circle algorithm — concise steps:
Initialize: set x = 0, y = r, and d = 3 − 2r.
Plot the symmetric points for current (x, y): plot (xc ± x, yc ± y) and the other seven symmetric positions.
Loop condition: repeat while x ≤ y (equivalently, stop when x > y).
Decision and updates:
If d < 0: update d = d + 4x + 6, then set x = x + 1. (y stays the same.)
If d ≥ 0: update d = d + 4*(x - y) + 10, set x = x + 1 and y = y - 1. (Move diagonally; y must decrease.)
Common mistake: incorrectly incrementing y when d ≥ 0. That is wrong because the correct diagonal step reduces y (y = y − 1); increasing y would move in the wrong direction and break the circle symmetry.