DDA and Bresenham Algorithm are terms you would have come across when studying computer graphics. The invention of computer made things simple and one of them being solving of differential equations. Earlier it was done by mechanical differential analyzer that was slow and full of errors but DDA or Digital differential Analyzer is the application of analyzer in digital form which is accurate and fast. Differential analyzer is used to make lines between two points so that a straight line or polygon with n number of sides can be seen on the screen. Distance between two points or a pixel is described by a differential equation where coordinates of the starting point and that of ending point are specified in the software. DDA is used in drawing straight line to form a line, triangle or polygon in computer graphics.
|Published (Last):||1 May 2016|
|PDF File Size:||1.90 Mb|
|ePub File Size:||2.52 Mb|
|Price:||Free* [*Free Regsitration Required]|
While drawing a line on computers they need to perform a set of computation, and it is not that simple as humans can do it in a simple way. So, in computer graphics, there are two algorithms used for drawing a line over the screen that is DDA Digital Differential Analyser algorithm and Bresenham algorithm. The chief difference between them is that the DDA algorithm uses floating point values while Bresenham employs integer with round off functions.
Furthermore, the implementation of the DDA algorithm involves multiplication and division while in bresenham algorithm, addition and subtraction are the main operations performed over the integers. Optimization Not provided Provided.
A DDA Digital Differential Analyzer algorithms is a scan-conversion method for drawing a line which follows an incremental approach. In this algorithm to draw a line the difference in the pixel points is analysed then according to that the line is drawn.
The method is said to be incremental because it performs computations at each step and uses the outcome of the previous step. Before understanding DDA algorithm, we must understand what is a line and how it is defined? When two points in a plane connected by a line segment and falls under the line equation is known as a line.
Depending on the slope three types of situations can arise shown in the below-given diagram: It does not use the floating point multiplication.
However, it uses the floating point addition which makes it faster than the straight implementation of the line equation. The algorithm is not precise because of the usage of floating point representation could cause computed points to drift away from their actual position when the line is relatively long.
Bresenham algorithm also provides an efficient raster scan method for generating lines where incremental integer calculations are used. The developer of the algorithm was Jack Elton Bresenham, and the algorithm was named after him.
It generates mathematically precise results with the help of addition, subtraction and multiplication by 2, which can be achieved by a simple arithmetic shift operation.
The above-given diagram explains the illustration of the straight line drawn over a display screen. Here the vertical axes indicate scan line positions, and the horizontal axes signify pixel columns. In the sampling at unit x intervals as shown in example , we need to figure out which possible pixel positions lie nearer to the line path at each consequent step.
So, this algorithm does it by examining the sign of an integer parameter, where its value is equal to the difference between the separation of the two pixel position from the true line path. Then the pixel location over the line path are then calculated by sampling at unit x intervals.
It begins from the left endpoint x 0 , y 0 of a provided line, then each consecutive column x position is considered, and pixels are plotted where the scan-line y value is nearest to the line path. In that condition, we plot the lower pixel. Otherwise, the upper pixel is plotted. Integrated changes along the line occur in unit steps in any of the direction x or y. Therefore, the consequent decision parameters are calculated using an incremental approach.
This iterative calculation of decision parameters is carried out at every integer x position, beginning from the left coordinate endpoint of the line. The Bresenhem line drawing algorithm is more efficient and better in all aspects than the DDA algorithm which is not that efficient. Your email address will not be published. The DDA algorithm involves floating point values while in bresenham algorithm only integer values is included.
This is the major reason that made the computations in DDA difficult than the bresenham algorithm. DDA uses multiplication and division operations. As against, bresenham involves addition and subtraction causing less consumption of time.
Therefore, DDA is slower than bresenham. The values in DDA never rounded off. In contrast, bresenham rounds off the value to the closest integer value. Bresenham algorithm is optimized. Conversely, DDA is not and less expensive. Leave a Reply Cancel reply Your email address will not be published.
Difference Between DDA n Bresenham.doc
Previously, we were using analytical analyzers to compute the pixels and thereby line drawings were made possible. But these analytical methods are not as accurate as the digital methods that with the usage of these digital algorithms now and as with every field, we have been inventing higher quality methods in computer graphics as well. The invention of these algorithms is a perfect example. Before we proceed, let us look at the concept behind these algorithms. Though it seems out of the scope of our discussion, it is essential to point out the basic differences between the two. If you are really familiar with the algorithms, you can jump to the actual differences located at the end of this page. A DDA is mostly used to draw lines in computer graphics and uses real values while predicting the next pixel values.
Difference Between DDA and Bresenham line drawing algorithm
While drawing a line on computers they need to perform a set of computation, and it is not that simple as humans can do it in a simple way. So, in computer graphics, there are two algorithms used for drawing a line over the screen that is DDA Digital Differential Analyser algorithm and Bresenham algorithm. The chief difference between them is that the DDA algorithm uses floating point values while Bresenham employs integer with round off functions. Furthermore, the implementation of the DDA algorithm involves multiplication and division while in bresenham algorithm, addition and subtraction are the main operations performed over the integers. Optimization Not provided Provided. A DDA Digital Differential Analyzer algorithms is a scan-conversion method for drawing a line which follows an incremental approach.