4 ms·
At least the first 2d line drawing given isn't Bresenham's algorithm [1]. Bresenham's is specialised to a particular octant and only requires one comparison ins
by ghusbands 6y ago
At least the first 2d line drawing given isn't Bresenham's algorithm [1]. Bresenham's is specialised to a particular octant and only requires one comparison inside the loop (which amounts to an overflow check). The algorithm given in the article will necessarily be significantly slower. The same applies to many other forms in the article.
[1] [PDF] https://web.archive.org/web/20080528040104/http://www.research.ibm.com/journal/sj/041/ibmsjIVRIC.pdf https://web.archive.org/web/20080528040104/http://www.resear...