Drag the two points around. Despite this being a published and well-known algorithm, there is very little difference in the lines drawn by this and those drawn by @MasterOfArithmetic's anti-aliasing algorithm, which uses a very clever trick that takes advantage of an implementation detail in the standard Bresenham code. He deserves to have his algorithm be much better known! (Honestly, it's worth a short paper in SigGraph...)
Framework by @MasterOfArithmetic Anti-aliasing algorithm by Xiaolin Wu. ( http://en.wikipedia.org/wiki/Xiaolin_Wu%27s_line_algorithm ) If you're looking for code to reuse, I recommend this one instead: http://scratch.mit.edu/projects/49447164/ (same as 'original project' below)