DDA Line Drawing Algorithm
DDA Line Drawing Algorithm
OR
OR
• Line
• Point
• Polygon
• Rectangle
• Filled Region
• Arc
• Character
• Sector
• Ellipse
Digital Differential Analyser (DDA) Line drawing Algorithm
Given-
•Starting coordinates = (X0, Y0) •Ending coordinates = (Xn, Yn)
Step-01:
• Suppose the current point is (Xp, Yp) and the next point is (Xp+1, Yp+1).
• Find the next point by following the below three cases-
Step-03:
Calculate the points between the starting point (5, 6) and ending point (8, 12).
Given-
• Starting coordinates = (X0, Y0) = (5, 6)
• Ending coordinates = (Xn, Yn) = (8, 12)
Step-01:
5 6 5.5 7 (6, 7)
6 8 (6, 8)
6.5 9 (7, 9)
7 10 (7, 10)
8 12 (8, 12)
Assignment:1
Q1. Calculate the points between the starting point (5, 6) and ending point (13, 10).
Q2. Implement the DDA line algorithm using any programming language (note: using of line function is not
allowed)
Drawbacks of DDA Algorithm-