2
Most read
5
Most read
6
Most read
DDA Line Algorithm
Dr. Snehlata Barde
Profesor & HoD, MSIT
MATS University,Raipur
 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.
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) = - /-
(DDA) ALGORITHM
 Step 1 Input the coordinates of the Two end
points A(x1, y1) and B(x2, y2) for the line AB
respectively. Note that points A and B are not
equal. (If they are equal, then it is a point. Plot
the point and return.)
 Step 2: [Calculate dx and dy]
dx = (x2 — x1) and dy = (y2— y1)
 Step 3: [Calculate the length L]
If (abs (x2 — x1) >abs (y2 — yl)) then
L = abs(x2 — x1)
Else L = abs (y2 — y1)
(DDA) ALGORITHM
 Step 4: [Calculate the increment factor]
 ∆x = (x2— x1)/L and ∆y = (y2 — y1)/L
This step makes either ∆x or ∆y equal to 1, because L is
either |x2 - x1| or |y2 — y1| Therefore, a step increment
in x or y direction is equal to 1.
 Step 5: [Initialize the initial point on the line and plot]
=x1 + 0.5 and = + 0.5
 Plot (Integer (), Integer ())
The values are rounded using the factor of 0.5 rather
than truncating, so that the central pixel addressing is
handled correctly. Moreover, the sign function given
makes the algorithm work in all the quadrants.
(DDA) ALGORITHM
 step 6: [Obtain the new pixel on the line and plot the
same]
 Initialize i to 1
 While (i<= L){
 = + ∆ x
= + ∆ y
 Plot (Integer(), Integer())
i = i + 1}
 Step 7: Finish
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.

More Related Content

PPTX
Dda algorithm
PPT
2D transformation (Computer Graphics)
PDF
Graphics a buffer
PPT
Circle drawing algo.
PPTX
Event Handling in java
PPTX
Video display devices
PPTX
GRPHICS01 - Introduction to 3D Graphics
Dda algorithm
2D transformation (Computer Graphics)
Graphics a buffer
Circle drawing algo.
Event Handling in java
Video display devices
GRPHICS01 - Introduction to 3D Graphics

What's hot (20)

PPTX
sutherland- Hodgeman Polygon clipping
PPTX
Area filling algo
PDF
Computer graphics lab report with code in cpp
PPTX
Concept of basic illumination model
PPTX
PPTX
Line Drawing Algorithms - Computer Graphics - Notes
PPT
Two dimensional viewing
PPT
applications of computer graphics
PDF
Computer Graphics - Output Primitive
PPTX
Halftoning in Computer Graphics
PPTX
Depth Buffer Method
PPTX
Hough Transform By Md.Nazmul Islam
PPTX
Output primitives in Computer Graphics
PPTX
Computer graphics LINE DRAWING algorithm.pptx
PPTX
Chapter 1
PPT
Input devices in computer graphics
PPTX
All pair shortest path
PPTX
Applications Of Computer Graphics
PDF
Code optimization in compiler design
PPTX
Raster scan system & random scan system
sutherland- Hodgeman Polygon clipping
Area filling algo
Computer graphics lab report with code in cpp
Concept of basic illumination model
Line Drawing Algorithms - Computer Graphics - Notes
Two dimensional viewing
applications of computer graphics
Computer Graphics - Output Primitive
Halftoning in Computer Graphics
Depth Buffer Method
Hough Transform By Md.Nazmul Islam
Output primitives in Computer Graphics
Computer graphics LINE DRAWING algorithm.pptx
Chapter 1
Input devices in computer graphics
All pair shortest path
Applications Of Computer Graphics
Code optimization in compiler design
Raster scan system & random scan system
Ad

Similar to dda-line-algorithm.pptx of computer graphics (20)

PPTX
DDA algorithm
PDF
Lline Drawing Algorithm
PPTX
Computer Graphics - Introduction in Brief By: Prof. Manisha Waghmare- Butkar
PPTX
DDA (Digital Differential Analyzer ) Line Drawing Algorithm.pptx
PPT
Lecture _Line Scan Conversion.ppt
PPTX
Raster Scan Graphics, Line Drawing Algorithm and Circle Drawing Algorithm
PDF
Computer Graphics_Module 2_Output Primitives.pdf
PPTX
DDA-line-drawing-algorithm.pptx
PDF
Line drawing Algorithm DDA in computer Graphics.pdf
PPTX
4 CG_U1_M3_PPT_4 DDA.pptx
PPT
02 - raster topic in computer graphics.ppt
PDF
Unit-2 raster scan graphics,line,circle and polygon algorithms
PPTX
Chapter 3 - Part 1 [Autosaved].pptx
PPT
Bresenham circles and polygons derication
PPT
Bresenham circlesandpolygons
PDF
Chapter 2 Computer graphics by Kushal Bhattarai
PPT
1 linedrawing
PDF
Notes_456_Lines_Drawing2_4 (1).pdf
PDF
raster algorithm.pdf
PPT
Lab lecture 1 line_algo
DDA algorithm
Lline Drawing Algorithm
Computer Graphics - Introduction in Brief By: Prof. Manisha Waghmare- Butkar
DDA (Digital Differential Analyzer ) Line Drawing Algorithm.pptx
Lecture _Line Scan Conversion.ppt
Raster Scan Graphics, Line Drawing Algorithm and Circle Drawing Algorithm
Computer Graphics_Module 2_Output Primitives.pdf
DDA-line-drawing-algorithm.pptx
Line drawing Algorithm DDA in computer Graphics.pdf
4 CG_U1_M3_PPT_4 DDA.pptx
02 - raster topic in computer graphics.ppt
Unit-2 raster scan graphics,line,circle and polygon algorithms
Chapter 3 - Part 1 [Autosaved].pptx
Bresenham circles and polygons derication
Bresenham circlesandpolygons
Chapter 2 Computer graphics by Kushal Bhattarai
1 linedrawing
Notes_456_Lines_Drawing2_4 (1).pdf
raster algorithm.pdf
Lab lecture 1 line_algo
Ad

Recently uploaded (20)

PDF
LS-6-Digital-Literacy (1) K12 CURRICULUM .pdf
PPTX
Wireless sensor networks (WSN) SRM unit 2
PDF
ST MNCWANGO P2 WIL (MEPR302) FINAL REPORT.pdf
PDF
Using Technology to Foster Innovative Teaching Practices (www.kiu.ac.ug)
PDF
IAE-V2500 Engine Airbus Family A319/320
PPTX
AI-Reporting for Emerging Technologies(BS Computer Engineering)
PPTX
Unit IImachinemachinetoolopeartions.pptx
PDF
AIGA 012_04 Cleaning of equipment for oxygen service_reformat Jan 12.pdf
PPTX
Module1.pptxrjkeieuekwkwoowkemehehehrjrjrj
PDF
Project_Mgmt_Institute_-Marc Marc Marc .pdf
PPTX
INTERNET OF THINGS - EMBEDDED SYSTEMS AND INTERNET OF THINGS
PDF
ASPEN PLUS USER GUIDE - PROCESS SIMULATIONS
PDF
Engineering Solutions for Ethical Dilemmas in Healthcare (www.kiu.ac.ug)
PPTX
WN UNIT-II CH4_MKaruna_BapatlaEngineeringCollege.pptx
PPT
Comprehensive Java Training Deck - Advanced topics
PPTX
CS6006 - CLOUD COMPUTING - Module - 1.pptx
PDF
Performance, energy consumption and costs: a comparative analysis of automati...
PDF
Cryptography and Network Security-Module-I.pdf
PDF
MACCAFERRY GUIA GAVIONES TERRAPLENES EN ESPAÑOL
PPT
UNIT-I Machine Learning Essentials for 2nd years
LS-6-Digital-Literacy (1) K12 CURRICULUM .pdf
Wireless sensor networks (WSN) SRM unit 2
ST MNCWANGO P2 WIL (MEPR302) FINAL REPORT.pdf
Using Technology to Foster Innovative Teaching Practices (www.kiu.ac.ug)
IAE-V2500 Engine Airbus Family A319/320
AI-Reporting for Emerging Technologies(BS Computer Engineering)
Unit IImachinemachinetoolopeartions.pptx
AIGA 012_04 Cleaning of equipment for oxygen service_reformat Jan 12.pdf
Module1.pptxrjkeieuekwkwoowkemehehehrjrjrj
Project_Mgmt_Institute_-Marc Marc Marc .pdf
INTERNET OF THINGS - EMBEDDED SYSTEMS AND INTERNET OF THINGS
ASPEN PLUS USER GUIDE - PROCESS SIMULATIONS
Engineering Solutions for Ethical Dilemmas in Healthcare (www.kiu.ac.ug)
WN UNIT-II CH4_MKaruna_BapatlaEngineeringCollege.pptx
Comprehensive Java Training Deck - Advanced topics
CS6006 - CLOUD COMPUTING - Module - 1.pptx
Performance, energy consumption and costs: a comparative analysis of automati...
Cryptography and Network Security-Module-I.pdf
MACCAFERRY GUIA GAVIONES TERRAPLENES EN ESPAÑOL
UNIT-I Machine Learning Essentials for 2nd years

dda-line-algorithm.pptx of computer graphics

  • 1. DDA Line Algorithm Dr. Snehlata Barde Profesor & HoD, MSIT MATS University,Raipur
  • 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. 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) = - /-
  • 5. (DDA) ALGORITHM  Step 1 Input the coordinates of the Two end points A(x1, y1) and B(x2, y2) for the line AB respectively. Note that points A and B are not equal. (If they are equal, then it is a point. Plot the point and return.)  Step 2: [Calculate dx and dy] dx = (x2 — x1) and dy = (y2— y1)  Step 3: [Calculate the length L] If (abs (x2 — x1) >abs (y2 — yl)) then L = abs(x2 — x1) Else L = abs (y2 — y1)
  • 6. (DDA) ALGORITHM  Step 4: [Calculate the increment factor]  ∆x = (x2— x1)/L and ∆y = (y2 — y1)/L This step makes either ∆x or ∆y equal to 1, because L is either |x2 - x1| or |y2 — y1| Therefore, a step increment in x or y direction is equal to 1.  Step 5: [Initialize the initial point on the line and plot] =x1 + 0.5 and = + 0.5  Plot (Integer (), Integer ()) The values are rounded using the factor of 0.5 rather than truncating, so that the central pixel addressing is handled correctly. Moreover, the sign function given makes the algorithm work in all the quadrants.
  • 7. (DDA) ALGORITHM  step 6: [Obtain the new pixel on the line and plot the same]  Initialize i to 1  While (i<= L){  = + ∆ x = + ∆ y  Plot (Integer(), Integer()) i = i + 1}  Step 7: Finish
  • 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.