Bresenham line-drawing-algorithm By S L Sonawane.pdf
SujataSonawane11
1,284 views
12 slides
Feb 16, 2024
Slide 1 of 12
1
2
3
4
5
6
7
8
9
10
11
12
About This Presentation
Line Drawing Algorithm
Size: 692.81 KB
Language: en
Added: Feb 16, 2024
Slides: 12 pages
Slide Content
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