Vertical line on HxW canvas of pixels
- by bobby williams
I searched and found nothing.
I'm trying to draw lines (simple y=mx+b ones) on a canvas of black pixels.
It works fine, but no line occurs when it is vertical. I'm not sure why. My first if statement checks if the denominator is zero, therefore m is undefined and no need for a line equation.
My second and third if statement check how steep it is…