The DDA algorithm for lines with -1 < m < 1.

This slide shows the modified form of the algorithm. We start at (xl,yl), and at each step add 1 to x, and m to y. As before, we round the true y-value to determine the nearest pixel:

x = xl;
ytrue = yl;
while (x <= xr){

ytrue = ytrue + m;
y = Round (ytrue);
PlotPixel (x, y);
x = x + 1;
}
Back

Quit