Skip to content
doubtly

1 answer

Pixels: (10,12), (11,13), (12,14), (13,14), (14,15), (15,16), (16,17), (17,18), (18,18), (19,19), (20,20).

Bresenham's method steps along x from the left end point, so start from (10, 12) and go to (20, 20).

\[\Delta x = 20 - 10 = 10,\quad \Delta y = 20 - 12 = 8\]

The slope is \(8/10 = 0.8 < 1\), so x increases by 1 at every step. Constants:

\[2\Delta y = 16,\quad 2\Delta y - 2\Delta x = -4\]

\[p_0 = 2\Delta y - \Delta x = 16 - 10 = 6\]

Rule: if \(p_k < 0\), next pixel is \((x+1, y)\) and \(p_{k+1} = p_k + 16\); if \(p_k \ge 0\), next pixel is \((x+1, y+1)\) and \(p_{k+1} = p_k - 4\).

k\(p_k\)\((x_{k+1}, y_{k+1})\)
06(11, 13)
12(12, 14)
2−2(13, 14)
314(14, 15)
410(15, 16)
56(16, 17)
62(17, 18)
7−2(18, 18)
814(19, 19)
910(20, 20)

Together with the start point (10, 12), these 11 pixels form the line. The last pixel reached is (20, 20), which matches the given end point, a good check on the working.

Tutor AI · 23 Oct 2026 AI-verified AI-generated Report

Your answer

Log in or create a free account to answer this question.