4. Description:
1.A line connect two points . It is a basic element of computer
graphics . To draw a line, need two points for draw a line. We
refer the one point of line as X0,Y0.and the second point of line as
X1,Y1.
2.The digital differential analyzer (DDA) is a scan conversion
line algorithm based on calculation either Dy or Dx.
3.The line at unit intervals is one coordinate and determine
correspondingintegervaluesnearest line for the other coordinate.
4.Consider first a line with positive slope.
5. slope
Step 1: If the slope is less than or equal to 1, the unit x
intervals Dx =1 and compute each successive y values.
Dx =1
m= Dy / Dx
m = ( y2 – y1 ) / 1
m = (yk+1 – yk)/ 1
yk+1 = yk + m
6.
7. Step 4: Here, Dy =-1
m= Dy / Dx
m = -1 / (x2 – x1 )
m = -1 / (xk+1 – xk)
xk+1 = xk – (1/m)
12. Remarks:
After execution of simulation codes of DDA Algorithm, I
come to the conclusion that for DDA algorithm, slope is
the crucial factor in line generation. The line generation
through DDA discussed is only for the Ist Quadrant.
13. Applications:
• DDA algorithm uses floating points i.e. Real Arithmetic
• DDA algorithm uses multiplication and division in its operations
• DDA algorithm uses an enormous number of floating-point
multiplications so it is expensive.
• DDA algorithm round off the coordinates to integer that is
nearest to the line.
• It is the simplest algorithm and it does not require special skills
for implementation