**DDA line drawing algorithm**

**(Digital Differential Analyzers)**

Digital
Differential Analyzers is the scan conversion line algorithm , which is based
on calculating del y or del x, sample of the line and unit intervals in one
coordinate and determine corresponding integer values nearest the line path for
the coordinates. Consider first a line with positive slope. If the slop is less
then or equal to one be sample at unit. X interval

del x = 1

and complete each
successive y value as

y

_{k+1 }= y_{k }+ m (6)
subscript k takes
integer value starting from 1 for the 1

^{st}point & the inversed by 1 unit the find end point is reached.
For lines with the positive with the positive stop that
greater then 1 we reverts the role of y i.e we sample at wait y interval

del y = 1

and calculate each successive x value as

x

_{k+1 }= x_{k }+ 1/m (7)
from equation 6 and 7

are based on the assumption that lines are to be processed
from left to right.

If the processing is reverse that is from right to left then
be have

Del
x = del y = -1

So ,

y

_{k+1 }= y_{k }– m (8)
x

_{k+1 }= x_{k }-1/m (9)
also check this post :- line-drawing-algorithm

## No comments:

## Post a Comment