Bresenham’s Line Algorithm
WITH SOLVED EXAMPLE
Prof. Sujata L. Sonawane
Assistant Professor
Department of Artificial Intelligence and Machine Learning
P.E.S. Modern College of Engineering, Pune.
⮚ Uses only integer addition and subtraction and multiplication
by 2.
⮚ Computer is time-efficient when performing integer
multiplication by powers of 2.
⮚ Efficient method for scan-converting straight lines.
⮚ Basic principle is to select the optimum raster locations to
represent a straight line. To accomplish this the algorithm
always increments either x or y one unit depending on the
slope of line.
Introduction
• The increment in the other variable is
determined by examining the distance
between the actual line location and nearest
pixel. This distance is called decision
parameter
( Δy - Δx )
Advantages
Bresenham Line Drawing Algorithm are-
● It is easy to implement.
● It is fast and incremental.
● It executes fast but less faster than DDA Algorithm.
● The points generated by this algorithm are more
accurate than DDA Algorithm.
● It uses fixed points only.
Disadvantage
Bresenham Line Drawing Algorithm are-
● Though it improves the accuracy of generated points but
still the resulted line is not smooth.
● This algorithm is for the basic line drawing.
● It can not handle diminishing jaggies.
Questions
• Use Bresenham’s line drawing algorithm to rasterize the line
with endpoints (5,5) and (13,9). OR
Consider the line from (5, 5) to (13, 9). Use the Bresenham
algorithm to rasterize the line. - 10 M
• Draw a line from (0,0) to (-6,-4) by using bresenham’s algorithm.
3M
• Express a line from (10,12) to (20,16) on a raster screen using
Bresenham’s straight line algorithm. Show the result on a
cartesian graph. -6M
• Explain Bresenham line algorithm and show how bresenham’s
line algorithm draws a line that starts with (4,4) and end with (-
3,0) -6 M
THANK YOU

Bresenham line-drawing-algorithm By S L Sonawane.pdf

  • 1.
    Bresenham’s Line Algorithm WITHSOLVED EXAMPLE Prof. Sujata L. Sonawane Assistant Professor Department of Artificial Intelligence and Machine Learning P.E.S. Modern College of Engineering, Pune.
  • 2.
    ⮚ Uses onlyinteger addition and subtraction and multiplication by 2. ⮚ Computer is time-efficient when performing integer multiplication by powers of 2. ⮚ Efficient method for scan-converting straight lines. ⮚ Basic principle is to select the optimum raster locations to represent a straight line. To accomplish this the algorithm always increments either x or y one unit depending on the slope of line. Introduction
  • 3.
    • The incrementin the other variable is determined by examining the distance between the actual line location and nearest pixel. This distance is called decision parameter
  • 6.
    ( Δy -Δx )
  • 9.
    Advantages Bresenham Line DrawingAlgorithm are- ● It is easy to implement. ● It is fast and incremental. ● It executes fast but less faster than DDA Algorithm. ● The points generated by this algorithm are more accurate than DDA Algorithm. ● It uses fixed points only.
  • 10.
    Disadvantage Bresenham Line DrawingAlgorithm are- ● Though it improves the accuracy of generated points but still the resulted line is not smooth. ● This algorithm is for the basic line drawing. ● It can not handle diminishing jaggies.
  • 11.
    Questions • Use Bresenham’sline drawing algorithm to rasterize the line with endpoints (5,5) and (13,9). OR Consider the line from (5, 5) to (13, 9). Use the Bresenham algorithm to rasterize the line. - 10 M • Draw a line from (0,0) to (-6,-4) by using bresenham’s algorithm. 3M • Express a line from (10,12) to (20,16) on a raster screen using Bresenham’s straight line algorithm. Show the result on a cartesian graph. -6M • Explain Bresenham line algorithm and show how bresenham’s line algorithm draws a line that starts with (4,4) and end with (- 3,0) -6 M
  • 12.