SlideShare a Scribd company logo
2
Most read
5
Most read
6
Most read
SUBJECT : COMPUTER GRAPHICS
 In Computer Graphics the first basic line drawing
algorithm is Digital Differential Analyzer (DDA)
Algorithm.
 A line connects two points. It is a basic element in
graphics. To draw a line, you need two points
between which you can draw a line.
 In computer graphics, a digital differential analyzer
(DDA) is hardware or software used for
interpolation of variables over an interval between
start and end point. DDAs are used for rasterization
of lines, triangles and polygons. They can be
extended to non linear functions, such as
perspective correct texture mapping, quadratic
curves, and traversing voxels.
DIGITAL DIFFERENTIAL ANALYZER (DDA)
ALGORITHM.
COMPUTER HAS TO TAKE CARE OF 2 THINGS:
 Pixels
- Which pixels to plot.
 Computations
- Computations required to calculate pixel positions
SLOPE INTERCEPT LINE EQ:
 y = mx + b
 m = slope
 b = is the y intercept, is called as “slope intercept line
equation.”
 Therefore
 Slope(m) = dy/dx
 Slope(m) = y2 - y1 / x2 - x1
 b= y1 – m.x1 (y intercept)
(DDA) ALGORITHM
 Walk through the line, starting at (x0,y0)
 Constrain x, y increments to values in [0,1] range
 Case a: x is incrementing faster (m < 1)
 Step in x=1 increments, compute and round y
 Case b: y is incrementing faster (m > 1)
 Step in y=1 increments, compute and round x
DDA LINE DRAWING ALGORITHM (CASE A: M
< 1)
 x = x0 y = y0
 (x, round(y)
 Here y = y0+m.x
 x=1
 Similarly
 x=x0+1 y=y0+m
 m<1 = x↑↑ more than y or dy/dx<1
 Until x == x1
DDA LINE DRAWING ALGORITHM (CASE B: M
> 1)
 m>1 = this implies y↑↑ more than x or dy/dx >1
 x k+1=x k+1/m y k+1= y k+1
 x = x0 y = y0
 Plot (round(x), y)
x = x+1/m y= y+ 1
 … Until y == y1
ADVANTAGES
 1. It is the simplest algorithm and it does not require
special skills for implementation.
 2. It is a faster method for calculating pixel positions
than the direct use of equation y=mx + b. It
eliminates the multiplication in the equation by
making use of raster characteristics, so that
appropriate increments are applied in the x or y
direction to find the pixel positions along the line
path.
DISVANTANGES
 1. Floating point arithmetic in DDA algorithm is still
time-consuming.
 2. The algorithm is orientation dependent. Hence
end point accuracy is poor.
Dda algorithm

More Related Content

PPTX
Computer graphics ppt
PPTX
Polygon filling algorithm
PPTX
Computer Graphics - Windowing and Clipping
PPTX
Presentation on INTERNET | PPT
PPTX
Computer graphics - bresenham line drawing algorithm
PPT
Raster scan system
PDF
Data Communication and Networking
PPTX
Software requirement specification
Computer graphics ppt
Polygon filling algorithm
Computer Graphics - Windowing and Clipping
Presentation on INTERNET | PPT
Computer graphics - bresenham line drawing algorithm
Raster scan system
Data Communication and Networking
Software requirement specification

What's hot (20)

PPTX
Output primitives in Computer Graphics
PPTX
BRESENHAM’S LINE DRAWING ALGORITHM
PDF
3D Transformation
PPT
Line drawing algo.
PPT
Visible surface detection in computer graphic
PPTX
DDA algorithm
PPTX
Bresenham's line drawing algorithm
PPT
Clipping
PPTX
Computer graphics LINE DRAWING algorithm.pptx
PPTX
Bezier curve & B spline curve
PPTX
Cyrus beck line clipping algorithm
PPTX
Line Drawing Algorithms - Computer Graphics - Notes
PPTX
Frame buffer
PPTX
DDA-line-drawing-algorithm.pptx
PPTX
Dda line algorithm presentatiion
PPTX
Raster animation
PPTX
Clipping
PPTX
Polygons - Computer Graphics - Notes
PPTX
Introduction to computer graphics
PPT
Input devices in computer graphics
Output primitives in Computer Graphics
BRESENHAM’S LINE DRAWING ALGORITHM
3D Transformation
Line drawing algo.
Visible surface detection in computer graphic
DDA algorithm
Bresenham's line drawing algorithm
Clipping
Computer graphics LINE DRAWING algorithm.pptx
Bezier curve & B spline curve
Cyrus beck line clipping algorithm
Line Drawing Algorithms - Computer Graphics - Notes
Frame buffer
DDA-line-drawing-algorithm.pptx
Dda line algorithm presentatiion
Raster animation
Clipping
Polygons - Computer Graphics - Notes
Introduction to computer graphics
Input devices in computer graphics
Ad

Similar to Dda algorithm (20)

PPTX
dda-line-algorithm.pptx of computer graphics
PPTX
Study on Fundamentals of Raster Scan Graphics
PPT
03.Scan Conversion.ppt
PPT
Lecture _Line Scan Conversion.ppt
PPT
computer_graphics_line_algorithm in Computer Graphics
PDF
raster algorithm.pdf
PPT
Bresenham circlesandpolygons
PPT
Bresenham circles and polygons derication
PPT
Unit I-cg.ppt Introduction to Computer Graphics elements
PPT
Introduction to Computer Graphics elements
PPT
Introduction to Computer Graphics computer
PPT
Output Primitives in Computer Graphics and Multimedia
PPT
Computer Graphics and Multimedia Output primitives
PPTX
Computer graphics presentation
PPT
Lab lecture 1 line_algo
PPTX
4 CG_U1_M3_PPT_4 DDA.pptx
PDF
Lline Drawing Algorithm
PDF
Computer graphics notes watermark
PDF
Computer Graphics_Module 2_Output Primitives.pdf
PPTX
Computer Graphics Unit 1
dda-line-algorithm.pptx of computer graphics
Study on Fundamentals of Raster Scan Graphics
03.Scan Conversion.ppt
Lecture _Line Scan Conversion.ppt
computer_graphics_line_algorithm in Computer Graphics
raster algorithm.pdf
Bresenham circlesandpolygons
Bresenham circles and polygons derication
Unit I-cg.ppt Introduction to Computer Graphics elements
Introduction to Computer Graphics elements
Introduction to Computer Graphics computer
Output Primitives in Computer Graphics and Multimedia
Computer Graphics and Multimedia Output primitives
Computer graphics presentation
Lab lecture 1 line_algo
4 CG_U1_M3_PPT_4 DDA.pptx
Lline Drawing Algorithm
Computer graphics notes watermark
Computer Graphics_Module 2_Output Primitives.pdf
Computer Graphics Unit 1
Ad

More from Mani Kanth (20)

PPTX
White box testing
PPTX
Unit testing
PPTX
System testing
PPTX
management of maintainance
PPTX
Se (techniques for black box testing ppt)
PPTX
Reverse engineering in software engineering vaibhav
PPTX
Mutation testing 1
PPTX
Mutation testing
PPTX
Guideline for euivalence class testing
PPTX
Equivalence class testing
PPTX
Deployment
PPTX
unit testing
PPTX
Window to viewport transformation&amp;matrix representation of homogeneous co...
PPTX
The sutherland hodgeman polygon clipping algorithm
PPT
Seed filling algorithm
PPTX
Scaling and shearing
PPTX
Reflection transformation
PPTX
Raster and random scan display types of input devices
PPTX
Projection
PPTX
Polygon clipping with sutherland hodgeman algorithm and scan line fill algorithm
White box testing
Unit testing
System testing
management of maintainance
Se (techniques for black box testing ppt)
Reverse engineering in software engineering vaibhav
Mutation testing 1
Mutation testing
Guideline for euivalence class testing
Equivalence class testing
Deployment
unit testing
Window to viewport transformation&amp;matrix representation of homogeneous co...
The sutherland hodgeman polygon clipping algorithm
Seed filling algorithm
Scaling and shearing
Reflection transformation
Raster and random scan display types of input devices
Projection
Polygon clipping with sutherland hodgeman algorithm and scan line fill algorithm

Recently uploaded (20)

PPTX
Recipes for Real Time Voice AI WebRTC, SLMs and Open Source Software.pptx
PDF
Arduino robotics embedded978-1-4302-3184-4.pdf
PDF
SM_6th-Sem__Cse_Internet-of-Things.pdf IOT
PDF
Embodied AI: Ushering in the Next Era of Intelligent Systems
PPTX
Sustainable Sites - Green Building Construction
PPTX
Internet of Things (IOT) - A guide to understanding
PDF
PRIZ Academy - 9 Windows Thinking Where to Invest Today to Win Tomorrow.pdf
PPTX
bas. eng. economics group 4 presentation 1.pptx
DOCX
ASol_English-Language-Literature-Set-1-27-02-2023-converted.docx
PPTX
FINAL REVIEW FOR COPD DIANOSIS FOR PULMONARY DISEASE.pptx
PDF
PPT on Performance Review to get promotions
PPT
Project quality management in manufacturing
PDF
Model Code of Practice - Construction Work - 21102022 .pdf
PDF
keyrequirementskkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk
PDF
composite construction of structures.pdf
PPTX
Foundation to blockchain - A guide to Blockchain Tech
PPTX
additive manufacturing of ss316l using mig welding
PDF
Evaluating the Democratization of the Turkish Armed Forces from a Normative P...
PPTX
KTU 2019 -S7-MCN 401 MODULE 2-VINAY.pptx
PDF
The CXO Playbook 2025 – Future-Ready Strategies for C-Suite Leaders Cerebrai...
Recipes for Real Time Voice AI WebRTC, SLMs and Open Source Software.pptx
Arduino robotics embedded978-1-4302-3184-4.pdf
SM_6th-Sem__Cse_Internet-of-Things.pdf IOT
Embodied AI: Ushering in the Next Era of Intelligent Systems
Sustainable Sites - Green Building Construction
Internet of Things (IOT) - A guide to understanding
PRIZ Academy - 9 Windows Thinking Where to Invest Today to Win Tomorrow.pdf
bas. eng. economics group 4 presentation 1.pptx
ASol_English-Language-Literature-Set-1-27-02-2023-converted.docx
FINAL REVIEW FOR COPD DIANOSIS FOR PULMONARY DISEASE.pptx
PPT on Performance Review to get promotions
Project quality management in manufacturing
Model Code of Practice - Construction Work - 21102022 .pdf
keyrequirementskkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk
composite construction of structures.pdf
Foundation to blockchain - A guide to Blockchain Tech
additive manufacturing of ss316l using mig welding
Evaluating the Democratization of the Turkish Armed Forces from a Normative P...
KTU 2019 -S7-MCN 401 MODULE 2-VINAY.pptx
The CXO Playbook 2025 – Future-Ready Strategies for C-Suite Leaders Cerebrai...

Dda algorithm

  • 2.  In Computer Graphics the first basic line drawing algorithm is Digital Differential Analyzer (DDA) Algorithm.  A line connects two points. It is a basic element in graphics. To draw a line, you need two points between which you can draw a line.  In computer graphics, a digital differential analyzer (DDA) is hardware or software used for interpolation of variables over an interval between start and end point. DDAs are used for rasterization of lines, triangles and polygons. They can be extended to non linear functions, such as perspective correct texture mapping, quadratic curves, and traversing voxels. DIGITAL DIFFERENTIAL ANALYZER (DDA) ALGORITHM.
  • 3. COMPUTER HAS TO TAKE CARE OF 2 THINGS:  Pixels - Which pixels to plot.  Computations - Computations required to calculate pixel positions
  • 4. SLOPE INTERCEPT LINE EQ:  y = mx + b  m = slope  b = is the y intercept, is called as “slope intercept line equation.”  Therefore  Slope(m) = dy/dx  Slope(m) = y2 - y1 / x2 - x1  b= y1 – m.x1 (y intercept)
  • 5. (DDA) ALGORITHM  Walk through the line, starting at (x0,y0)  Constrain x, y increments to values in [0,1] range  Case a: x is incrementing faster (m < 1)  Step in x=1 increments, compute and round y  Case b: y is incrementing faster (m > 1)  Step in y=1 increments, compute and round x
  • 6. DDA LINE DRAWING ALGORITHM (CASE A: M < 1)  x = x0 y = y0  (x, round(y)  Here y = y0+m.x  x=1  Similarly  x=x0+1 y=y0+m  m<1 = x↑↑ more than y or dy/dx<1  Until x == x1
  • 7. DDA LINE DRAWING ALGORITHM (CASE B: M > 1)  m>1 = this implies y↑↑ more than x or dy/dx >1  x k+1=x k+1/m y k+1= y k+1  x = x0 y = y0  Plot (round(x), y) x = x+1/m y= y+ 1  … Until y == y1
  • 8. ADVANTAGES  1. It is the simplest algorithm and it does not require special skills for implementation.  2. It is a faster method for calculating pixel positions than the direct use of equation y=mx + b. It eliminates the multiplication in the equation by making use of raster characteristics, so that appropriate increments are applied in the x or y direction to find the pixel positions along the line path.
  • 9. DISVANTANGES  1. Floating point arithmetic in DDA algorithm is still time-consuming.  2. The algorithm is orientation dependent. Hence end point accuracy is poor.