LINE DRAWING

Basic Line Drawing Problem Diagram

What we are going to look at are algorithms to choose which pixels to illuminate.


SOLUTION METHODS

1) Direct Solution:
     
2) DDA - Digital Difference Analyzer


     
MIDPOINT LINE ALGORITHM
    F(x,y) < 0 if point above the line


     

    Draw from P1 to P0: swap(P0,P1)
    Use y =y -1: dy = -dy, y=y - 1
    Switch X & Y:
    Swap (x1, y1), Swap (x0, y0 ), Swap (dx, dy)
    plotpoint(y,x)


    CIRCLE DRAWING


    MIDPOINT CIRCLE ALGORITHM