SlideShare ist ein Scribd-Unternehmen logo
1 von 14
COMPUTER GRAPHICS
PREPARED BY:
RUCHI MAURYA
BRESENHAM’S LINE
DRAWING ALGORITHM
INDEX
 INTRODUCTION
 DERIVATION
 EXAMPLE
 ADVANTAGES
 DISADVANTAGES
 REFERENCES
INTRODUCTION
• Raster line-generating algorithm
• Developed by Bresenham
• Scan conversion takes place
using only incremental integer
calculations
• Accurate and efficient than DDA
DERIVATION
• Starting from the left endpoint (x0, y0) of a given line,
we step to each successive column (x position) and plot
the pixel whose scan-line y value is closest to the line
path.
• At sample positions 𝑥 𝑘 + 1 the vertical separations
from the line are labelled 𝑑 𝑢𝑝𝑝𝑒𝑟 and 𝑑𝑙𝑜𝑤𝑒𝑟
• y coordinate on the line at 𝑥 𝑘 + 1 is,
𝑦 = 𝑚 𝑥 𝑘 + 1 + 𝑏
• so,
𝑑 𝑢𝑝𝑝𝑒𝑟 = 𝑦 − 𝑦 𝑘 = 𝑚 𝑥 𝑘 + 1 + 𝑏 − 𝑦 𝑘
𝑑𝑙𝑜𝑤𝑒𝑟 = 𝑦 𝑘 + 1 − 𝑦 = 𝑦 𝑘 + 1 − 𝑚 𝑥 𝑘 + 1 + 𝑏
𝑑𝑙𝑜𝑤𝑒𝑟
𝑑 𝑢𝑝𝑝𝑒𝑟
𝑥 𝑘 + 1
𝑦 𝑘 + 1
𝑦
𝑦 𝑘
DERIVATION
• It can be used to make decision about which pixel is closer to the line
• This decision is based on the difference between the two pixel positions,
𝑑 𝑢𝑝𝑝𝑒𝑟 − 𝑑𝑙𝑜𝑤𝑒𝑟 = 2𝑚 𝑥 𝑘 + 1 − 2𝑦 𝑘 + 2𝑏 − 1
• By substituting 𝑚 = ∆𝑦/∆𝑥 and both are differences of end points,
∆𝑥 𝑑 𝑢𝑝𝑝𝑒𝑟 − 𝑑𝑙𝑜𝑤𝑒𝑟 = ∆𝑥 2
∆𝑦
∆𝑥
𝑥 𝑘 + 1 − 2𝑦 𝑘 + 2𝑏 − 1
= 2∆𝑦. 𝑥 𝑘 − 2∆𝑥. 𝑦 𝑘 + 2∆𝑦 + ∆𝑥(2𝑏 − 1)
= 2∆𝑦. 𝑥 𝑘 − 2∆𝑥. 𝑦 𝑘 + 𝐶
DERIVATION
• Now, a decision parameter 𝑃𝑘 for the 𝑘th step along a line,
𝑃𝑘 = ∆𝑥 𝑑 𝑢𝑝𝑝𝑒𝑟 − 𝑑𝑙𝑜𝑤𝑒𝑟
= 2∆𝑦. 𝑥 𝑘 − 2∆𝑥. 𝑦 𝑘 + 𝐶
• The sign of 𝑃𝑘 is same as that of 𝑑 𝑢𝑝𝑝𝑒𝑟 − 𝑑𝑙𝑜𝑤𝑒𝑟
• If 𝑃𝑘 is –ve then we choose the lower pixel i.e. 𝑦 𝑘 only, otherwise we choose the upper
pixel i.e. 𝑦 𝑘 + 1
• So, for 𝑃𝑘 + 1 at step 𝑘 + 1,
𝑃𝑘+1 = 2∆𝑦. 𝑥 𝑘+1 − 2∆𝑥. 𝑦 𝑘+1 + 𝐶
• Subtracting 𝑃𝑘,
𝑃𝑘+1 − 𝑃𝑘 = 2∆𝑦(𝑥 𝑘+1 − 𝑥 𝑘) − 2∆𝑥(𝑦 𝑘+1 − 𝑦 𝑘) + 𝐶
DERIVATION
• 𝑥 𝑘+1 is same as 𝑥 𝑘 + 1 so,
𝑃𝑘+1 = 𝑃𝑘 + 2∆𝑦 − 2∆𝑥(𝑦 𝑘+1 − 𝑦 𝑘)
• Here, 𝑦 𝑘+1 − 𝑦 𝑘 is either 0 or 1 depending on the sign of 𝑃𝑘
• If 𝑃𝑘 < 0, the next point to plot is (𝑥 𝑘 + 1, 𝑦 𝑘) and new value of 𝑃 is,
𝑃𝑘+1 = 𝑃𝑘 + 2∆𝑦
• If 𝑃𝑘 > 0, the next point to plot is (𝑥 𝑘 + 1, 𝑦 𝑘 + 1) and new value of 𝑃 is,
𝑃𝑘+1 = 𝑃𝑘 + 2∆𝑦 − 2∆𝑥
• The first decision parameter 𝑃0 is evaluated at (𝑥0, 𝑦0) is,
𝑃0 = 2∆𝑦 − ∆𝑥
EXAMPLE
• End points (20,10) and (30,18)
• ∆𝑥=x2-x1 =30-20 =10
• ∆𝑦=y2-y1 =18-10 =8
• m= ∆𝑦/∆𝑥=8/10=0.8
𝑘 𝑃𝑘 (𝑥 𝑘+1, 𝑦 𝑘+1)
0 6 > 0 (21,11)
1 2 > 0 (22,12)
2 −2 < 0 (23,12)
3 14 > 0 (24,13)
4 10 > 0 (25,14)
𝑘 𝑃𝑘 (𝑥 𝑘+1, 𝑦 𝑘+1)
5 6 > 0 (26,15)
6 2 > 0 (27,16)
7 −2 < 0 (28,16)
8 14 > 0 (29,17)
9 10 > 0 (30,18)
EXAMPLE
21, 11
22, 12
23, 12
24, 13
25, 14 26, 15
27, 16
28, 16
29, 17
30, 18
10
11
12
13
14
15
16
17
18
19
20 21 22 23 24 25 26 27 28 29 30 31
ADVANTAGES
•Uses fixed points
•Easy to calculate (only addition & subtraction)
•Fast execution compare to DDA
•More accurate and efficient
DISADVANTAGES
• Drift away from actual line path
• Causes stair-case pattern
REFERENCES
•http://freefeast.info/
•http://www.expertsmind.com/
•http://www.answers.com/
THANKS A LOT….!!

Weitere ähnliche Inhalte

Was ist angesagt?

Output primitives in Computer Graphics
Output primitives in Computer GraphicsOutput primitives in Computer Graphics
Output primitives in Computer GraphicsKamal Acharya
 
Attributes of Output Primitives
Attributes of Output PrimitivesAttributes of Output Primitives
Attributes of Output PrimitivesRenita Santhmayora
 
Computer graphics basic transformation
Computer graphics basic transformationComputer graphics basic transformation
Computer graphics basic transformationSelvakumar Gna
 
Back face detection
Back face detectionBack face detection
Back face detectionPooja Dixit
 
Chapter 3 Output Primitives
Chapter 3 Output PrimitivesChapter 3 Output Primitives
Chapter 3 Output PrimitivesPrathimaBaliga
 
Window to viewport transformation
Window to viewport transformationWindow to viewport transformation
Window to viewport transformationAnkit Garg
 
2 d geometric transformations
2 d geometric transformations2 d geometric transformations
2 d geometric transformationsMohd Arif
 
Bezier curve & B spline curve
Bezier curve  & B spline curveBezier curve  & B spline curve
Bezier curve & B spline curveArvind Kumar
 
2D Transformation
2D Transformation2D Transformation
2D TransformationShahDhruv21
 
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
 
3D Transformation in Computer Graphics
3D Transformation in Computer Graphics3D Transformation in Computer Graphics
3D Transformation in Computer Graphicssabbirantor
 
Circle generation algorithm
Circle generation algorithmCircle generation algorithm
Circle generation algorithmAnkit Garg
 
3D Transformation
3D Transformation3D Transformation
3D TransformationSwatiHans10
 
2D viewing & clipping
2D viewing & clipping2D viewing & clipping
2D viewing & clippingMdAlAmin187
 
Ellipses drawing algo.
Ellipses drawing algo.Ellipses drawing algo.
Ellipses drawing algo.Mohd Arif
 
Character generation techniques
Character generation techniquesCharacter generation techniques
Character generation techniquesMani Kanth
 

Was ist angesagt? (20)

Curve clipping
Curve clippingCurve clipping
Curve clipping
 
Output primitives in Computer Graphics
Output primitives in Computer GraphicsOutput primitives in Computer Graphics
Output primitives in Computer Graphics
 
Attributes of Output Primitives
Attributes of Output PrimitivesAttributes of Output Primitives
Attributes of Output Primitives
 
Computer graphics basic transformation
Computer graphics basic transformationComputer graphics basic transformation
Computer graphics basic transformation
 
Computer graphics
Computer graphicsComputer graphics
Computer graphics
 
Back face detection
Back face detectionBack face detection
Back face detection
 
Chapter 3 Output Primitives
Chapter 3 Output PrimitivesChapter 3 Output Primitives
Chapter 3 Output Primitives
 
Window to viewport transformation
Window to viewport transformationWindow to viewport transformation
Window to viewport transformation
 
2 d geometric transformations
2 d geometric transformations2 d geometric transformations
2 d geometric transformations
 
Spline representations
Spline representationsSpline representations
Spline representations
 
Bezier curve & B spline curve
Bezier curve  & B spline curveBezier curve  & B spline curve
Bezier curve & B spline curve
 
2D Transformation
2D Transformation2D Transformation
2D Transformation
 
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...
 
3D Transformation in Computer Graphics
3D Transformation in Computer Graphics3D Transformation in Computer Graphics
3D Transformation in Computer Graphics
 
Circle generation algorithm
Circle generation algorithmCircle generation algorithm
Circle generation algorithm
 
3D Transformation
3D Transformation3D Transformation
3D Transformation
 
fractals
fractalsfractals
fractals
 
2D viewing & clipping
2D viewing & clipping2D viewing & clipping
2D viewing & clipping
 
Ellipses drawing algo.
Ellipses drawing algo.Ellipses drawing algo.
Ellipses drawing algo.
 
Character generation techniques
Character generation techniquesCharacter generation techniques
Character generation techniques
 

Ähnlich wie Computer graphics - bresenham line drawing algorithm

Unit-2 raster scan graphics,line,circle and polygon algorithms
Unit-2 raster scan graphics,line,circle and polygon algorithmsUnit-2 raster scan graphics,line,circle and polygon algorithms
Unit-2 raster scan graphics,line,circle and polygon algorithmsAmol Gaikwad
 
chapter 3 , foley.pptxhuujjjjjjjkjmmmm. Ibibhvucufucuvivihohi
chapter 3 , foley.pptxhuujjjjjjjkjmmmm.  Ibibhvucufucuvivihohichapter 3 , foley.pptxhuujjjjjjjkjmmmm.  Ibibhvucufucuvivihohi
chapter 3 , foley.pptxhuujjjjjjjkjmmmm. Ibibhvucufucuvivihohi54MahakBansal
 
numericai matmatic matlab uygulamalar ali abdullah
numericai matmatic  matlab  uygulamalar ali abdullahnumericai matmatic  matlab  uygulamalar ali abdullah
numericai matmatic matlab uygulamalar ali abdullahAli Abdullah
 
Linear regression, costs & gradient descent
Linear regression, costs & gradient descentLinear regression, costs & gradient descent
Linear regression, costs & gradient descentRevanth Kumar
 
DIFFERENTAL CALCULUS DERIVATIVES FIRST PART
DIFFERENTAL CALCULUS DERIVATIVES FIRST PARTDIFFERENTAL CALCULUS DERIVATIVES FIRST PART
DIFFERENTAL CALCULUS DERIVATIVES FIRST PARTteacherlablidas
 
Bresenham circlesandpolygons
Bresenham circlesandpolygonsBresenham circlesandpolygons
Bresenham circlesandpolygonsaa11bb11
 
Bresenham circles and polygons derication
Bresenham circles and polygons dericationBresenham circles and polygons derication
Bresenham circles and polygons dericationKumar
 
Open GL T0074 56 sm4
Open GL T0074 56 sm4Open GL T0074 56 sm4
Open GL T0074 56 sm4Roziq Bahtiar
 
Computer Graphics Unit 2
Computer Graphics Unit 2Computer Graphics Unit 2
Computer Graphics Unit 2SanthiNivas
 
07-Convolution.pptx signal spectra and signal processing
07-Convolution.pptx signal spectra and signal processing07-Convolution.pptx signal spectra and signal processing
07-Convolution.pptx signal spectra and signal processingJordanJohmMallillin
 
Computer Graphics Unit 1
Computer Graphics Unit 1Computer Graphics Unit 1
Computer Graphics Unit 1aravindangc
 
Chapter 3 - Part 1 [Autosaved].pptx
Chapter 3 - Part 1 [Autosaved].pptxChapter 3 - Part 1 [Autosaved].pptx
Chapter 3 - Part 1 [Autosaved].pptxKokebe2
 
Lines and curves algorithms
Lines and curves algorithmsLines and curves algorithms
Lines and curves algorithmsMohammad Sadiq
 
3 D GEOMETRY - ANGLE BETWEEN 2 LINES
3 D GEOMETRY - ANGLE BETWEEN 2 LINES3 D GEOMETRY - ANGLE BETWEEN 2 LINES
3 D GEOMETRY - ANGLE BETWEEN 2 LINESsumanmathews
 

Ähnlich wie Computer graphics - bresenham line drawing algorithm (20)

Unit-2 raster scan graphics,line,circle and polygon algorithms
Unit-2 raster scan graphics,line,circle and polygon algorithmsUnit-2 raster scan graphics,line,circle and polygon algorithms
Unit-2 raster scan graphics,line,circle and polygon algorithms
 
CG-Lecture3.pptx
CG-Lecture3.pptxCG-Lecture3.pptx
CG-Lecture3.pptx
 
chapter 3 , foley.pptxhuujjjjjjjkjmmmm. Ibibhvucufucuvivihohi
chapter 3 , foley.pptxhuujjjjjjjkjmmmm.  Ibibhvucufucuvivihohichapter 3 , foley.pptxhuujjjjjjjkjmmmm.  Ibibhvucufucuvivihohi
chapter 3 , foley.pptxhuujjjjjjjkjmmmm. Ibibhvucufucuvivihohi
 
numericai matmatic matlab uygulamalar ali abdullah
numericai matmatic  matlab  uygulamalar ali abdullahnumericai matmatic  matlab  uygulamalar ali abdullah
numericai matmatic matlab uygulamalar ali abdullah
 
Linear regression, costs & gradient descent
Linear regression, costs & gradient descentLinear regression, costs & gradient descent
Linear regression, costs & gradient descent
 
DIFFERENTAL CALCULUS DERIVATIVES FIRST PART
DIFFERENTAL CALCULUS DERIVATIVES FIRST PARTDIFFERENTAL CALCULUS DERIVATIVES FIRST PART
DIFFERENTAL CALCULUS DERIVATIVES FIRST PART
 
GraphTransformations.pptx
GraphTransformations.pptxGraphTransformations.pptx
GraphTransformations.pptx
 
Bresenham circlesandpolygons
Bresenham circlesandpolygonsBresenham circlesandpolygons
Bresenham circlesandpolygons
 
Bresenham circles and polygons derication
Bresenham circles and polygons dericationBresenham circles and polygons derication
Bresenham circles and polygons derication
 
Open GL T0074 56 sm4
Open GL T0074 56 sm4Open GL T0074 56 sm4
Open GL T0074 56 sm4
 
Computer Graphics Unit 2
Computer Graphics Unit 2Computer Graphics Unit 2
Computer Graphics Unit 2
 
07-Convolution.pptx signal spectra and signal processing
07-Convolution.pptx signal spectra and signal processing07-Convolution.pptx signal spectra and signal processing
07-Convolution.pptx signal spectra and signal processing
 
Computer Graphics Unit 1
Computer Graphics Unit 1Computer Graphics Unit 1
Computer Graphics Unit 1
 
module 1.pdf
module 1.pdfmodule 1.pdf
module 1.pdf
 
raster algorithm.pdf
raster algorithm.pdfraster algorithm.pdf
raster algorithm.pdf
 
Cs580
Cs580Cs580
Cs580
 
Chapter 3 - Part 1 [Autosaved].pptx
Chapter 3 - Part 1 [Autosaved].pptxChapter 3 - Part 1 [Autosaved].pptx
Chapter 3 - Part 1 [Autosaved].pptx
 
The derivatives module03
The derivatives module03The derivatives module03
The derivatives module03
 
Lines and curves algorithms
Lines and curves algorithmsLines and curves algorithms
Lines and curves algorithms
 
3 D GEOMETRY - ANGLE BETWEEN 2 LINES
3 D GEOMETRY - ANGLE BETWEEN 2 LINES3 D GEOMETRY - ANGLE BETWEEN 2 LINES
3 D GEOMETRY - ANGLE BETWEEN 2 LINES
 

Mehr von Ruchi Maurya

SHA- Secure hashing algorithm
SHA- Secure hashing algorithmSHA- Secure hashing algorithm
SHA- Secure hashing algorithmRuchi Maurya
 
Java- Datagram Socket class & Datagram Packet class
Java- Datagram Socket class  & Datagram Packet classJava- Datagram Socket class  & Datagram Packet class
Java- Datagram Socket class & Datagram Packet classRuchi Maurya
 
Nams- Roots of equations by numerical methods
Nams- Roots of equations by numerical methodsNams- Roots of equations by numerical methods
Nams- Roots of equations by numerical methodsRuchi Maurya
 
Types of Addressing modes- COA
Types of Addressing modes- COATypes of Addressing modes- COA
Types of Addressing modes- COARuchi Maurya
 
Random access memory
Random access memoryRandom access memory
Random access memoryRuchi Maurya
 
open system interconnection
open system interconnectionopen system interconnection
open system interconnectionRuchi Maurya
 

Mehr von Ruchi Maurya (7)

SHA- Secure hashing algorithm
SHA- Secure hashing algorithmSHA- Secure hashing algorithm
SHA- Secure hashing algorithm
 
Java- Datagram Socket class & Datagram Packet class
Java- Datagram Socket class  & Datagram Packet classJava- Datagram Socket class  & Datagram Packet class
Java- Datagram Socket class & Datagram Packet class
 
Nams- Roots of equations by numerical methods
Nams- Roots of equations by numerical methodsNams- Roots of equations by numerical methods
Nams- Roots of equations by numerical methods
 
Types of Addressing modes- COA
Types of Addressing modes- COATypes of Addressing modes- COA
Types of Addressing modes- COA
 
Social networking
Social networkingSocial networking
Social networking
 
Random access memory
Random access memoryRandom access memory
Random access memory
 
open system interconnection
open system interconnectionopen system interconnection
open system interconnection
 

Kürzlich hochgeladen

ACC 2024 Chronicles. Cardiology. Exam.pdf
ACC 2024 Chronicles. Cardiology. Exam.pdfACC 2024 Chronicles. Cardiology. Exam.pdf
ACC 2024 Chronicles. Cardiology. Exam.pdfSpandanaRallapalli
 
Science 7 Quarter 4 Module 2: Natural Resources.pptx
Science 7 Quarter 4 Module 2: Natural Resources.pptxScience 7 Quarter 4 Module 2: Natural Resources.pptx
Science 7 Quarter 4 Module 2: Natural Resources.pptxMaryGraceBautista27
 
Procuring digital preservation CAN be quick and painless with our new dynamic...
Procuring digital preservation CAN be quick and painless with our new dynamic...Procuring digital preservation CAN be quick and painless with our new dynamic...
Procuring digital preservation CAN be quick and painless with our new dynamic...Jisc
 
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...JhezDiaz1
 
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptxECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptxiammrhaywood
 
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️9953056974 Low Rate Call Girls In Saket, Delhi NCR
 
USPS® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...
USPS® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...USPS® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...
USPS® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...Postal Advocate Inc.
 
Transaction Management in Database Management System
Transaction Management in Database Management SystemTransaction Management in Database Management System
Transaction Management in Database Management SystemChristalin Nelson
 
HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...
HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...
HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...Nguyen Thanh Tu Collection
 
Choosing the Right CBSE School A Comprehensive Guide for Parents
Choosing the Right CBSE School A Comprehensive Guide for ParentsChoosing the Right CBSE School A Comprehensive Guide for Parents
Choosing the Right CBSE School A Comprehensive Guide for Parentsnavabharathschool99
 
Earth Day Presentation wow hello nice great
Earth Day Presentation wow hello nice greatEarth Day Presentation wow hello nice great
Earth Day Presentation wow hello nice greatYousafMalik24
 
ANG SEKTOR NG agrikultura.pptx QUARTER 4
ANG SEKTOR NG agrikultura.pptx QUARTER 4ANG SEKTOR NG agrikultura.pptx QUARTER 4
ANG SEKTOR NG agrikultura.pptx QUARTER 4MiaBumagat1
 
Incoming and Outgoing Shipments in 3 STEPS Using Odoo 17
Incoming and Outgoing Shipments in 3 STEPS Using Odoo 17Incoming and Outgoing Shipments in 3 STEPS Using Odoo 17
Incoming and Outgoing Shipments in 3 STEPS Using Odoo 17Celine George
 
Student Profile Sample - We help schools to connect the data they have, with ...
Student Profile Sample - We help schools to connect the data they have, with ...Student Profile Sample - We help schools to connect the data they have, with ...
Student Profile Sample - We help schools to connect the data they have, with ...Seán Kennedy
 
AMERICAN LANGUAGE HUB_Level2_Student'sBook_Answerkey.pdf
AMERICAN LANGUAGE HUB_Level2_Student'sBook_Answerkey.pdfAMERICAN LANGUAGE HUB_Level2_Student'sBook_Answerkey.pdf
AMERICAN LANGUAGE HUB_Level2_Student'sBook_Answerkey.pdfphamnguyenenglishnb
 
Inclusivity Essentials_ Creating Accessible Websites for Nonprofits .pdf
Inclusivity Essentials_ Creating Accessible Websites for Nonprofits .pdfInclusivity Essentials_ Creating Accessible Websites for Nonprofits .pdf
Inclusivity Essentials_ Creating Accessible Websites for Nonprofits .pdfTechSoup
 

Kürzlich hochgeladen (20)

Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
 
ACC 2024 Chronicles. Cardiology. Exam.pdf
ACC 2024 Chronicles. Cardiology. Exam.pdfACC 2024 Chronicles. Cardiology. Exam.pdf
ACC 2024 Chronicles. Cardiology. Exam.pdf
 
Raw materials used in Herbal Cosmetics.pptx
Raw materials used in Herbal Cosmetics.pptxRaw materials used in Herbal Cosmetics.pptx
Raw materials used in Herbal Cosmetics.pptx
 
Science 7 Quarter 4 Module 2: Natural Resources.pptx
Science 7 Quarter 4 Module 2: Natural Resources.pptxScience 7 Quarter 4 Module 2: Natural Resources.pptx
Science 7 Quarter 4 Module 2: Natural Resources.pptx
 
Procuring digital preservation CAN be quick and painless with our new dynamic...
Procuring digital preservation CAN be quick and painless with our new dynamic...Procuring digital preservation CAN be quick and painless with our new dynamic...
Procuring digital preservation CAN be quick and painless with our new dynamic...
 
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...
 
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptxECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
 
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
 
USPS® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...
USPS® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...USPS® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...
USPS® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...
 
Transaction Management in Database Management System
Transaction Management in Database Management SystemTransaction Management in Database Management System
Transaction Management in Database Management System
 
LEFT_ON_C'N_ PRELIMS_EL_DORADO_2024.pptx
LEFT_ON_C'N_ PRELIMS_EL_DORADO_2024.pptxLEFT_ON_C'N_ PRELIMS_EL_DORADO_2024.pptx
LEFT_ON_C'N_ PRELIMS_EL_DORADO_2024.pptx
 
HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...
HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...
HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...
 
Choosing the Right CBSE School A Comprehensive Guide for Parents
Choosing the Right CBSE School A Comprehensive Guide for ParentsChoosing the Right CBSE School A Comprehensive Guide for Parents
Choosing the Right CBSE School A Comprehensive Guide for Parents
 
Earth Day Presentation wow hello nice great
Earth Day Presentation wow hello nice greatEarth Day Presentation wow hello nice great
Earth Day Presentation wow hello nice great
 
ANG SEKTOR NG agrikultura.pptx QUARTER 4
ANG SEKTOR NG agrikultura.pptx QUARTER 4ANG SEKTOR NG agrikultura.pptx QUARTER 4
ANG SEKTOR NG agrikultura.pptx QUARTER 4
 
Incoming and Outgoing Shipments in 3 STEPS Using Odoo 17
Incoming and Outgoing Shipments in 3 STEPS Using Odoo 17Incoming and Outgoing Shipments in 3 STEPS Using Odoo 17
Incoming and Outgoing Shipments in 3 STEPS Using Odoo 17
 
Student Profile Sample - We help schools to connect the data they have, with ...
Student Profile Sample - We help schools to connect the data they have, with ...Student Profile Sample - We help schools to connect the data they have, with ...
Student Profile Sample - We help schools to connect the data they have, with ...
 
FINALS_OF_LEFT_ON_C'N_EL_DORADO_2024.pptx
FINALS_OF_LEFT_ON_C'N_EL_DORADO_2024.pptxFINALS_OF_LEFT_ON_C'N_EL_DORADO_2024.pptx
FINALS_OF_LEFT_ON_C'N_EL_DORADO_2024.pptx
 
AMERICAN LANGUAGE HUB_Level2_Student'sBook_Answerkey.pdf
AMERICAN LANGUAGE HUB_Level2_Student'sBook_Answerkey.pdfAMERICAN LANGUAGE HUB_Level2_Student'sBook_Answerkey.pdf
AMERICAN LANGUAGE HUB_Level2_Student'sBook_Answerkey.pdf
 
Inclusivity Essentials_ Creating Accessible Websites for Nonprofits .pdf
Inclusivity Essentials_ Creating Accessible Websites for Nonprofits .pdfInclusivity Essentials_ Creating Accessible Websites for Nonprofits .pdf
Inclusivity Essentials_ Creating Accessible Websites for Nonprofits .pdf
 

Computer graphics - bresenham line drawing algorithm

  • 3. INDEX  INTRODUCTION  DERIVATION  EXAMPLE  ADVANTAGES  DISADVANTAGES  REFERENCES
  • 4. INTRODUCTION • Raster line-generating algorithm • Developed by Bresenham • Scan conversion takes place using only incremental integer calculations • Accurate and efficient than DDA
  • 5. DERIVATION • Starting from the left endpoint (x0, y0) of a given line, we step to each successive column (x position) and plot the pixel whose scan-line y value is closest to the line path. • At sample positions 𝑥 𝑘 + 1 the vertical separations from the line are labelled 𝑑 𝑢𝑝𝑝𝑒𝑟 and 𝑑𝑙𝑜𝑤𝑒𝑟 • y coordinate on the line at 𝑥 𝑘 + 1 is, 𝑦 = 𝑚 𝑥 𝑘 + 1 + 𝑏 • so, 𝑑 𝑢𝑝𝑝𝑒𝑟 = 𝑦 − 𝑦 𝑘 = 𝑚 𝑥 𝑘 + 1 + 𝑏 − 𝑦 𝑘 𝑑𝑙𝑜𝑤𝑒𝑟 = 𝑦 𝑘 + 1 − 𝑦 = 𝑦 𝑘 + 1 − 𝑚 𝑥 𝑘 + 1 + 𝑏 𝑑𝑙𝑜𝑤𝑒𝑟 𝑑 𝑢𝑝𝑝𝑒𝑟 𝑥 𝑘 + 1 𝑦 𝑘 + 1 𝑦 𝑦 𝑘
  • 6. DERIVATION • It can be used to make decision about which pixel is closer to the line • This decision is based on the difference between the two pixel positions, 𝑑 𝑢𝑝𝑝𝑒𝑟 − 𝑑𝑙𝑜𝑤𝑒𝑟 = 2𝑚 𝑥 𝑘 + 1 − 2𝑦 𝑘 + 2𝑏 − 1 • By substituting 𝑚 = ∆𝑦/∆𝑥 and both are differences of end points, ∆𝑥 𝑑 𝑢𝑝𝑝𝑒𝑟 − 𝑑𝑙𝑜𝑤𝑒𝑟 = ∆𝑥 2 ∆𝑦 ∆𝑥 𝑥 𝑘 + 1 − 2𝑦 𝑘 + 2𝑏 − 1 = 2∆𝑦. 𝑥 𝑘 − 2∆𝑥. 𝑦 𝑘 + 2∆𝑦 + ∆𝑥(2𝑏 − 1) = 2∆𝑦. 𝑥 𝑘 − 2∆𝑥. 𝑦 𝑘 + 𝐶
  • 7. DERIVATION • Now, a decision parameter 𝑃𝑘 for the 𝑘th step along a line, 𝑃𝑘 = ∆𝑥 𝑑 𝑢𝑝𝑝𝑒𝑟 − 𝑑𝑙𝑜𝑤𝑒𝑟 = 2∆𝑦. 𝑥 𝑘 − 2∆𝑥. 𝑦 𝑘 + 𝐶 • The sign of 𝑃𝑘 is same as that of 𝑑 𝑢𝑝𝑝𝑒𝑟 − 𝑑𝑙𝑜𝑤𝑒𝑟 • If 𝑃𝑘 is –ve then we choose the lower pixel i.e. 𝑦 𝑘 only, otherwise we choose the upper pixel i.e. 𝑦 𝑘 + 1 • So, for 𝑃𝑘 + 1 at step 𝑘 + 1, 𝑃𝑘+1 = 2∆𝑦. 𝑥 𝑘+1 − 2∆𝑥. 𝑦 𝑘+1 + 𝐶 • Subtracting 𝑃𝑘, 𝑃𝑘+1 − 𝑃𝑘 = 2∆𝑦(𝑥 𝑘+1 − 𝑥 𝑘) − 2∆𝑥(𝑦 𝑘+1 − 𝑦 𝑘) + 𝐶
  • 8. DERIVATION • 𝑥 𝑘+1 is same as 𝑥 𝑘 + 1 so, 𝑃𝑘+1 = 𝑃𝑘 + 2∆𝑦 − 2∆𝑥(𝑦 𝑘+1 − 𝑦 𝑘) • Here, 𝑦 𝑘+1 − 𝑦 𝑘 is either 0 or 1 depending on the sign of 𝑃𝑘 • If 𝑃𝑘 < 0, the next point to plot is (𝑥 𝑘 + 1, 𝑦 𝑘) and new value of 𝑃 is, 𝑃𝑘+1 = 𝑃𝑘 + 2∆𝑦 • If 𝑃𝑘 > 0, the next point to plot is (𝑥 𝑘 + 1, 𝑦 𝑘 + 1) and new value of 𝑃 is, 𝑃𝑘+1 = 𝑃𝑘 + 2∆𝑦 − 2∆𝑥 • The first decision parameter 𝑃0 is evaluated at (𝑥0, 𝑦0) is, 𝑃0 = 2∆𝑦 − ∆𝑥
  • 9. EXAMPLE • End points (20,10) and (30,18) • ∆𝑥=x2-x1 =30-20 =10 • ∆𝑦=y2-y1 =18-10 =8 • m= ∆𝑦/∆𝑥=8/10=0.8 𝑘 𝑃𝑘 (𝑥 𝑘+1, 𝑦 𝑘+1) 0 6 > 0 (21,11) 1 2 > 0 (22,12) 2 −2 < 0 (23,12) 3 14 > 0 (24,13) 4 10 > 0 (25,14) 𝑘 𝑃𝑘 (𝑥 𝑘+1, 𝑦 𝑘+1) 5 6 > 0 (26,15) 6 2 > 0 (27,16) 7 −2 < 0 (28,16) 8 14 > 0 (29,17) 9 10 > 0 (30,18)
  • 10. EXAMPLE 21, 11 22, 12 23, 12 24, 13 25, 14 26, 15 27, 16 28, 16 29, 17 30, 18 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31
  • 11. ADVANTAGES •Uses fixed points •Easy to calculate (only addition & subtraction) •Fast execution compare to DDA •More accurate and efficient
  • 12. DISADVANTAGES • Drift away from actual line path • Causes stair-case pattern