Computer Science, asked by umeforever7902, 1 year ago

Advantages of bresenham line algorithm over dda

Answers

Answered by desdeepak2p394gw
23

DDA and Bresenham algorithms both are efficient line drawing algorithm. Breaenham's algorithm has the following advantages on DDA:  (1) DDA uses float numbers and uses operators such as division and multiplication in its calculation. Bresenhams algorithm uses ints and only uses addition and subtraction. (2) Due to the use of only addition, subtraction and bit shifting Bresenhams algorithm is faster than DDA in producing the line.  (3) Fixed point DDA algorithms are generally superior to Bresenhams algoritm on modern computers. The reason is that Bresenhams algoritm uses a conditional branch in the3 loop and this result in frequent branch mis-predictions in the CPU. (4) Fixed point DDA also has fewer instructions in the loop body (one bit shift, one increment and one addition to be exact. In addition to the loop instructions and the actual plotting. As CPU pipelines become deeper mis predictions penalties will become more severe.  (5) Since DDA uses rounding off of the pixel position obtained by multiplication of division, causes an accumulation of error in the proceeding pixels whereas in Bresenhams line algorithm the new pixel is calculated with a small unit change in one direction and checking of nearest pixel with the decision variable satisfying the line equation.  (6) Fixed point DDA does not require conditional jumps, you can compute several lines in parallel with SIMD (Single Instruction Multiple Data techniques. 
Answered by Anonymous
5

Advantages of Bresenham line algorithm over DDA:

Bresenham:

  • It uses int data type for the calculations which is much more simpler.
  • Faster as only integers bits are used.
  • It uses fixed point system that increases the efficiency.
  • Rounds off well to the integer value.

DDA:

  • It uses float data type for the calculations which makes it complex.
  • Slower than Bresenham.
  • Less effiecient.
  • DDA being a float algorithm does not round off to an integer.
Similar questions