What is Bresenham line algorithm in computer graphics?
Bresenham’s line algorithm is a line drawing algorithm that determines the points of an n-dimensional raster that should be selected in order to form a close approximation to a straight line between two points.
What is the equation of initial decision parameter in Bresenham line drawing algorithm?
Step5: For m < 1: Calculate initial decision variable: P = 2dy – dx.
What is the advantage of Bresenham line drawing algorithm?
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.
How Bresenham’s line algorithm works explain with example?
This algorithm is used for scan converting a line. It was developed by Bresenham. It is an efficient method because it involves only integer addition, subtractions, and multiplication operations. These operations can be performed very rapidly so lines can be generated quickly….Bresenham’s Line Algorithm:
| x | y | d=d+I1 or I2 |
|---|---|---|
| 7 | 4 | d+I2=7+(-6)=1 |
| 8 | 5 |
What is the difference between DDA and Bresenham line drawing algorithm?
The main distinction between DDA algorithm and Bresenham line algorithm is that, the DDA algorithmic rule uses floating purpose values whereas in Bresenham, spherical off functions is used.
How is decision parameter calculated in Bresenham?
Algorithm for slope |m|>1:
- Input two end points (x1,y1) and (x2,y2) of the line.
- Plot the first point (x1,y1).
- Calculate. Delx =| x2 – x1 | Dely = | y2 – y1 |
- Obtain the initial decision parameter as. P = 2 * delx – dely.
- For I = 0 to dely in step of 1. If p < 0 then. y1 = y1 + 1. Pot(x1,y1) P = p+ 2delx. Else. X1 = x1 + 1.
- END.
What is the complexity of Bresenham line drawing algorithm?
Answer: c. Due to integer operations, it’s complexity gets reduced. Explanation: The Bresenham’s algorithm has quite low complexity due to its integer-based operations.
What are the disadvantages of Bresenham’s algorithm?
Disadvantages of Bresenham Line Drawing Algorithm-
- 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.
Why Bresenham algorithm is faster than DDA?
Bresenhams algorithm is faster than DDA algorithm in line drawing because it performs only addition and subtraction in its calculations and uses only integer arithmetic so it runs significantly faster.
What is decision parameter in Bresenham’s algorithm?
decision parameter as the name suggests is a criteria based on which further calculations are made. For example in Bresenham algorithm if decision factor is > 0 then one set of actions takes place and if decision factor is < 0, then some other steps are to be followed.