To Study The Difference Between Digital Differential Analyser (DDA) and Bresenham Line Drawing Algorithm
To Study The Difference Between Digital Differential Analyser (DDA) and Bresenham Line Drawing Algorithm
To study the difference between Digital Differential Analyser (DDA) and Bresenham
Line drawing Algorithm.
Theory
Procedure
DDA ALGORITHM :
1. Start.
2. Accept End points of the line which are (x1, y1) and (x2, y2).
3. Calculate the Length of the Line segment:
then
length = abs(x2-x1).
else
5. Initialize:
x=x1+0.5.
y=y1+0.5.
i=1.
x = x + xincr.
y = y + yincr.
i = i + 1.
7. Stop.
BRESENHAM ALGORITHM :
1. Start.
3. Calculate:
4. dx = abs(x2-x1)
5.
dy = abs(y2-y1)
if ( dx >= dy )
then
length = dx
else
length = dy
5. Calculate Initial Decision Parameter as:
d = 2 dy - dx
6. Calculate:
7. incr1 = 2 * dy – 2 * dx
8.
incr2 = 2 * dy
8. Initialize:
9. x=x1
10.
11. y=y1
12.
i=1
36. Stop.
Simulation
Conclusion: From this we can find the difference between DDA Alogrithm Bresenham Alogrithm