Professional Documents
Culture Documents
DDA Line Drawing Algorithm
DDA Line Drawing Algorithm
i.e. dy>dx
x(new)=x(old)+1;
y(new)=y(old)+m;
putpixel(x(new),y(new));
for m<1(case 2)
i.e.dy<dx
y(new)=y(old)+1;
1
x(new)=x(old)+ ;
putpixel(x(new),y(new));
IN the above eqns as m can have floating values we have to round off the x(new) and y(new)
values.
Thus here we floor the values using floor() function in C/C++.
Advantages:
It provides faster method than using the y=mx+c eqn for plotting
The round off operations causes roundoff erros which may cause deviation from actual
line path thus hinders the accuracy.