DDA Line Drawing
Digital differential analyzer — stepping by the larger delta.
Current pixel
step 0: x=2.0, y=2.0 → pixel (2,2)
Algorithm
- Compute dx, dy; steps = max(|dx|, |dy|).
- xinc = dx/steps, yinc = dy/steps.
- Start at (x0,y0); repeatedly add increments and round to the nearest pixel.
This example: dx=33, dy=15, steps=33.