This is the Xiaolin Wu line algorithm. It takes the end points of one line at a time and outputs the coordinates of the line between the end points. This improves upon the Breshenam line algorithm which simply outputs blocks and does not allow for a line to be part of two pixels (eg. a diagonal line).