Bresenham'S Line Drawing Algorithm
Bresenham'S Line Drawing Algorithm
Bresenham'S Line Drawing Algorithm
Rasmi M
Assistant Professor
Department of Computer Science and Applications
St. Mary’s College Thrissur
INTRODUCTION
Then,
dlower= y-yk
dupper=(yk+1)-y
dlower=m(xk+1)+c-yk
dupper=(yk+1)-m(xk+1)-c
dlower-dupper=2m(xk+1)-2yk+2c-1 .
Replacing m;
Δx(dlower-dupper)=Δx(2Δy/Δx(xk+1)-2yk+2c-1)
=2Δy.xk-2Δx.yk+b
(b=-2yk+2c-1)
1. Input the two line endpoints and store the left end point in (x0,y0).
2. Load (x0,y0) into the frame buffer that is plot the first point.
3. Calculate the constants x,y,2Δy-2Δx and obtain the starting value
for the decision parameter as
p0=2Δy-Δx