SlideShare ist ein Scribd-Unternehmen logo
1 von 1
Downloaden Sie, um offline zu lesen
www.eazynotes.com

Gursharan Singh Tatla

Page No. 1

DDA LINE ALGORITHM
DDA Line ( X1, Y1, XN, YN):
Description: Here X1 and Y1 denote the starting x – coordinate and y – coordinate of the line
and XN and YN denote the ending x – coordinate and y – coordinate.
1.

Set M = (YN – Y1) / (XN – X1)

2.

Repeat For I = X1 to XN

3.

If (M <= 1) Then

4.

Set DX = 1

5.

Set DY = M * DX

6.

Else

7.

Set DY = 1

8.

Set DX = DY / M
[End of If]

9.

Set X1 = X1 + DX

10.

Set Y1 = Y1 + DY

11.

Call PutPixel(X1, Y1)
[End of For]

12.

Exit

[Calculate slope of line]

Weitere ähnliche Inhalte

Was ist angesagt?

Lines and curves algorithms
Lines and curves algorithmsLines and curves algorithms
Lines and curves algorithmsMohammad Sadiq
 
Bresenham's line algorithm
Bresenham's line algorithmBresenham's line algorithm
Bresenham's line algorithmPooja Dixit
 
Circle drawing algo.
Circle drawing algo.Circle drawing algo.
Circle drawing algo.Mohd Arif
 
Computer graphics - bresenham line drawing algorithm
Computer graphics - bresenham line drawing algorithmComputer graphics - bresenham line drawing algorithm
Computer graphics - bresenham line drawing algorithmRuchi Maurya
 
Bresenham Line Drawing Algorithm
Bresenham Line Drawing AlgorithmBresenham Line Drawing Algorithm
Bresenham Line Drawing AlgorithmMahesh Kodituwakku
 
Line drawing algo.
Line drawing algo.Line drawing algo.
Line drawing algo.Mohd Arif
 
Computer Graphics - Bresenham's line drawing algorithm & Mid Point Circle alg...
Computer Graphics - Bresenham's line drawing algorithm & Mid Point Circle alg...Computer Graphics - Bresenham's line drawing algorithm & Mid Point Circle alg...
Computer Graphics - Bresenham's line drawing algorithm & Mid Point Circle alg...Saikrishna Tanguturu
 
Chapter 3 Output Primitives
Chapter 3 Output PrimitivesChapter 3 Output Primitives
Chapter 3 Output PrimitivesPrathimaBaliga
 
Bresenham derivation
Bresenham derivationBresenham derivation
Bresenham derivationKumar
 
Graphics6 bresenham circlesandpolygons
Graphics6 bresenham circlesandpolygonsGraphics6 bresenham circlesandpolygons
Graphics6 bresenham circlesandpolygonsThirunavukarasu Mani
 
Output primitives in Computer Graphics
Output primitives in Computer GraphicsOutput primitives in Computer Graphics
Output primitives in Computer GraphicsKamal Acharya
 
Graphics6 bresenham circlesandpolygons
Graphics6 bresenham circlesandpolygonsGraphics6 bresenham circlesandpolygons
Graphics6 bresenham circlesandpolygonsKetan Jani
 

Was ist angesagt? (20)

Lines and curves algorithms
Lines and curves algorithmsLines and curves algorithms
Lines and curves algorithms
 
Bresenham's line algorithm
Bresenham's line algorithmBresenham's line algorithm
Bresenham's line algorithm
 
Circle drawing algo.
Circle drawing algo.Circle drawing algo.
Circle drawing algo.
 
Computer graphics - bresenham line drawing algorithm
Computer graphics - bresenham line drawing algorithmComputer graphics - bresenham line drawing algorithm
Computer graphics - bresenham line drawing algorithm
 
Bresenham circle
Bresenham circleBresenham circle
Bresenham circle
 
Bresenham Line Drawing Algorithm
Bresenham Line Drawing AlgorithmBresenham Line Drawing Algorithm
Bresenham Line Drawing Algorithm
 
Line drawing algo.
Line drawing algo.Line drawing algo.
Line drawing algo.
 
Bresenhams
BresenhamsBresenhams
Bresenhams
 
Dda algorithm
Dda algorithmDda algorithm
Dda algorithm
 
DDA algorithm
DDA algorithmDDA algorithm
DDA algorithm
 
Computer Graphics - Bresenham's line drawing algorithm & Mid Point Circle alg...
Computer Graphics - Bresenham's line drawing algorithm & Mid Point Circle alg...Computer Graphics - Bresenham's line drawing algorithm & Mid Point Circle alg...
Computer Graphics - Bresenham's line drawing algorithm & Mid Point Circle alg...
 
Chapter 3 Output Primitives
Chapter 3 Output PrimitivesChapter 3 Output Primitives
Chapter 3 Output Primitives
 
Cs580
Cs580Cs580
Cs580
 
bresenham circles and polygons in computer graphics(Computer graphics tutorials)
bresenham circles and polygons in computer graphics(Computer graphics tutorials)bresenham circles and polygons in computer graphics(Computer graphics tutorials)
bresenham circles and polygons in computer graphics(Computer graphics tutorials)
 
Bresenham derivation
Bresenham derivationBresenham derivation
Bresenham derivation
 
Line circle draw
Line circle drawLine circle draw
Line circle draw
 
BRESENHAM’S LINE DRAWING ALGORITHM
BRESENHAM’S  LINE DRAWING ALGORITHMBRESENHAM’S  LINE DRAWING ALGORITHM
BRESENHAM’S LINE DRAWING ALGORITHM
 
Graphics6 bresenham circlesandpolygons
Graphics6 bresenham circlesandpolygonsGraphics6 bresenham circlesandpolygons
Graphics6 bresenham circlesandpolygons
 
Output primitives in Computer Graphics
Output primitives in Computer GraphicsOutput primitives in Computer Graphics
Output primitives in Computer Graphics
 
Graphics6 bresenham circlesandpolygons
Graphics6 bresenham circlesandpolygonsGraphics6 bresenham circlesandpolygons
Graphics6 bresenham circlesandpolygons
 

Andere mochten auch

Andere mochten auch (11)

dda algorithm
dda  algorithmdda  algorithm
dda algorithm
 
Digital Differential Analyzer Line Drawing Algorithm
Digital Differential Analyzer Line Drawing AlgorithmDigital Differential Analyzer Line Drawing Algorithm
Digital Differential Analyzer Line Drawing Algorithm
 
hermite cubic spline curve
hermite cubic spline curvehermite cubic spline curve
hermite cubic spline curve
 
Perspective projection
Perspective projectionPerspective projection
Perspective projection
 
[Download] rev chapter-5-june26th
[Download] rev chapter-5-june26th[Download] rev chapter-5-june26th
[Download] rev chapter-5-june26th
 
Analytical chemistry_Instrumentation_Introduction
Analytical chemistry_Instrumentation_IntroductionAnalytical chemistry_Instrumentation_Introduction
Analytical chemistry_Instrumentation_Introduction
 
Presentation non parametric
Presentation non parametricPresentation non parametric
Presentation non parametric
 
Parametric equations
Parametric equationsParametric equations
Parametric equations
 
Hermite spline english_20161201_jintaeks
Hermite spline english_20161201_jintaeksHermite spline english_20161201_jintaeks
Hermite spline english_20161201_jintaeks
 
Presentation on bezier curve
Presentation on bezier curvePresentation on bezier curve
Presentation on bezier curve
 
Non parametric tests
Non parametric testsNon parametric tests
Non parametric tests
 

Mehr von Praveen Kumar

Mehr von Praveen Kumar (20)

Summer2014 internship
Summer2014 internshipSummer2014 internship
Summer2014 internship
 
Summer+training 2
Summer+training 2Summer+training 2
Summer+training 2
 
Summer+training
Summer+trainingSummer+training
Summer+training
 
Solutions1.1
Solutions1.1Solutions1.1
Solutions1.1
 
Slides15
Slides15Slides15
Slides15
 
Scribed lec8
Scribed lec8Scribed lec8
Scribed lec8
 
Scholarship sc st
Scholarship sc stScholarship sc st
Scholarship sc st
 
Networks 2
Networks 2Networks 2
Networks 2
 
Mithfh lecturenotes 9
Mithfh lecturenotes 9Mithfh lecturenotes 9
Mithfh lecturenotes 9
 
Mcs student
Mcs studentMcs student
Mcs student
 
Math350 hw2solutions
Math350 hw2solutionsMath350 hw2solutions
Math350 hw2solutions
 
Matching
MatchingMatching
Matching
 
Lecture3
Lecture3Lecture3
Lecture3
 
Lec2 state space
Lec2 state spaceLec2 state space
Lec2 state space
 
Graphtheory
GraphtheoryGraphtheory
Graphtheory
 
Graphics display-devicesmod-1
Graphics display-devicesmod-1Graphics display-devicesmod-1
Graphics display-devicesmod-1
 
Games.4
Games.4Games.4
Games.4
 
Cs344 lect15-robotic-knowledge-inferencing-prolog-11feb08
Cs344 lect15-robotic-knowledge-inferencing-prolog-11feb08Cs344 lect15-robotic-knowledge-inferencing-prolog-11feb08
Cs344 lect15-robotic-knowledge-inferencing-prolog-11feb08
 
Cse3461.c.signal encoding.09 04-2012
Cse3461.c.signal encoding.09 04-2012Cse3461.c.signal encoding.09 04-2012
Cse3461.c.signal encoding.09 04-2012
 
Comerv3 1-12(2)
Comerv3 1-12(2)Comerv3 1-12(2)
Comerv3 1-12(2)
 

Dda line-algorithm

  • 1. www.eazynotes.com Gursharan Singh Tatla Page No. 1 DDA LINE ALGORITHM DDA Line ( X1, Y1, XN, YN): Description: Here X1 and Y1 denote the starting x – coordinate and y – coordinate of the line and XN and YN denote the ending x – coordinate and y – coordinate. 1. Set M = (YN – Y1) / (XN – X1) 2. Repeat For I = X1 to XN 3. If (M <= 1) Then 4. Set DX = 1 5. Set DY = M * DX 6. Else 7. Set DY = 1 8. Set DX = DY / M [End of If] 9. Set X1 = X1 + DX 10. Set Y1 = Y1 + DY 11. Call PutPixel(X1, Y1) [End of For] 12. Exit [Calculate slope of line]