The lineSimple() method:
|Lecture 5||Slide 5||6.837 Fall '98|
This algorithm works well when the desired line's slope is less than 1, but the lines become more and more discontinuous as the slope increases beyond one. Since this algorithm iterates over values of x between x0 and x1 there is a pixel drawn in each column. When the slope is greater than one then often more than one pixel must be drawn in each column for the line to appear continuous.
The progression of line drawing algorithms that we will cover is basically a case study in optimization techniques; at least that's how they will be treated here. The optimization methodology that we will cover is very general and can be applied to a wide range of algorithms.