Bresenham's line-drawing algorithm
en.wikipedia.org