1. Explain the Bresenham line generation algorithm via digitizing the line with end points as (15, 5) and also (25,13).
Ans. Now we are utilizing the Bresenham line generation algorithm via digitising the line with end points (15, 5) and also (25,13).
m =( y_{2} -y_{1}) /(x_{2} - x_{1})
= Δy/ Δx
= (13 - 5)/(25 - 15)
= 0.8------------------------(1)
⇒ Δ y = 8 and Δ x = 10 -------------------(2)
So the value of initial decision parameter (p0) = 2Δy - Δ x= 2 * 8 - 10 = 6 ------------(3)
Hence the values of increments for calculating successive decision parameters are:
2Δy = 2 * 8 = 16; -------------------(4)
2Δy - 2Δx = 2 * 8 - 2 * 10 = - 4 -------------------(5)
Then plot initial point (x_{0}, y_{0}) = (15, 5) in the frame buffer now find out successive pixel positions beside line path from decision parameters value of (15, 5).