Example: Exemplify the Bresenham line generation algorithm through digitizing the line along with end points (20, 10) and (30, 18)
Solution: m = (y2  y1)/( x2  x1)
= (Δy) /(Δx)
= (18 10)/( 30  20) = 0.8(1)
=> Δy = 8 and Δx = 10(2)
value of initial decision parameter (p0) = 2Δy  Δx= 2 * 8  10 = 6 (3) value of increments for calculating successive decision parameters are:
2Δy = 2 * 8 = 16; (4)
2Δy  2Δx = 2 * 8  2 * 10 =  4 (5)
So plot first point (x_{0}, y_{0}) = (20, 10) in frame buffer at this time determine successive pixel positions beside line path from decision parameters value (20, 10).
k
0

pk
6

(xk + 1, yk + 1) (21, 11)

1

2

(22, 12)

2

 2

(23, 12)

3

14

(24, 13)

4

10

(25, 14)

5

6

(26, 15)

6

2

(27, 16)

7

 2

(28, 16)

8

14

(29, 17)

9

10

(30, 18)



← [use step (d) of algorithm Δ x times]
If p_{k} > 0 then increase both X and Y
and p_{k }+1= p_{k} + 2Δy  2Δx
If p_{k} < 0 then increase X and not Y
and p_{k }+ 1 = p_{k} + 2Δy