The algorithm only worked when dy < dx and both were positive (octant). But by cleverly swapping directions and endpoints, the same algorithm worked for any line endpoints. I was pretty proud of it ...
On the Bresenham algorithm as implemented by Marlin: (Taken from (https://www.cs.helsinki.fi/group/goa/mallinnus/lines/bresenh.html) The basic Bresenham algorithm ...
Step 2 : Initialize the graphics header files and functions. Step 3 : Declare the required variables and functions. Step 4 : Get the four points for drawing a line namely x1,x2,y1,y2. Step 5 : Draw ...