1. The document discusses the Digital Differential Analyzer (DDA) line drawing algorithm, which is used to approximate and draw line segments on a discrete pixel grid.
2. The DDA algorithm works by calculating the slope of the line between two endpoints, then incrementally stepping from pixel to pixel and calculating the corresponding y-value.
3. The algorithm handles both horizontal, vertical, and diagonal lines by calculating the change in x and y between endpoints and using those values to determine how much to increment x and y with each step.
1. DDA Line Drawing
Algorithm
Muhammad Hamza
157101
Bioinformatics 7th
Graphics andVisualization
Presented to: Sir Muhammad Rizwan
Govt Post Graduate College Mandian
Abbottabad
2. Talk Sequence:
• What is Line
• Line Equation
• Slope of Line
• Examples of Drawing Line
• DDA
3. DDA Line Drawing Algorithm
• DDA stands for Digital Differential Analyzer
• A line drawing algorithm is a graphical algorithm for approximating a line
segment on discrete graphical media.
• This algorithm is used to draw a line on computer pixels.
4. What is a Line?
• A line in Computer graphics typically refers to line segment, which is a
portion of straight line that extends indefinitely in opposite direction.
• It is defined by its two end points & the slope intercept equation for a line:
y = mx + b
where, m = Slope of the line
b = the y intercept of a line
5. • The two endpoints of a line segment are specified at positions (x1,y1) and
(x2,y2).
6. Slope Conditions for Algorithms
• 1. ∆ y/ ∆ x > 1 when 0 >45
• 2. ∆ y/ ∆ x < 1 when 0 <45
• 3. ∆ y /∆ x = 1 when 0 =45
1
2
3
14. Limitation
• There are no decimal points in coordinate system
• Time consuming because algorithm may generate floating numbers
• Line generated will not be smooth.