DDA Algorithm:-
It stands for Digital Differential Step 9:
Analyzer. It is an incremental method x = x + Xin
of scan conversion of line. In this y = y + Yin
method calculation is performed at Set pixel [Round(x), Round(y)]
each step but by using results of
previous steps. Step 10:
Repeat step 9 until
Step-1: x=x2
Start Algorithm
Step 11:
Step-2: End algorithm
Declare x1, y1, x2, y2, dx, dy, x, y
Ex:
Step-3:
Enter value of x1, y1, x2, y2
Step-4:
dx = x2 – x1,
Step-5:
dy = y2 – y1
Step-6:
If [ABS (dx) > ABS (dy)]
Then step = abs (dx)
Else step = abs (dy)
Step-7:
Xin = dx/step & Yin = dy/step
Assign x = x1 & y = y1
Step 8:
Set pixel (x,y)