- Asked 6/25
- 2070 Asar · 3 marks
- 2070 Chaitra · 2 marks
- 2068 Bhadra (old course) · 3 marks
- 2078 Bhadra · 3 marks
- 2076 Chaitra · 2 marks
- 2075 Chaitra · 2 marks
DDA versus Bresenham line algorithm
Short answer
DDA uses floating-point arithmetic and rounding, causing slow speed and accumulated error. Bresenham’s algorithm uses only integer addition/subtraction with a decision parameter p, no rounding, no error accumulation, making it faster and hardware-friendly.
Differentiate between the DDA and Bresenham's line drawing algorithms: what are the demerits of DDA and how does Bresenham's algorithm address them (advantages of Bresenham's algorithm)?
| Point | DDA | Bresenham's |
|---|---|---|
| Arithmetic | Floating-point (slope m, increments) | Integer only (additions, subtractions, shifts) |
| Rounding | Round() needed at every step | No rounding; uses a decision parameter |
| Speed | Slower | Faster |
| Accuracy | Rounding errors accumulate (drift) on long lines | Accurate; error does not accumulate |
| Pixel choice | Rounds the computed y to the nearest integer | Chooses the pixel closest to the true line using the sign of p |
| Hardware | Hard to implement | Easy to implement in hardware |
| Operations | One division for the increments, then a floating-point addition and rounding per step | Integer additions/subtractions only |
Demerits of DDA
- Uses floating-point operations and rounding at every step, which is slow.
- Accumulated round-off error in x and y makes the pixel positions drift from the true line, especially for long lines.
- Needs a division to find the slope or step size.
How Bresenham's algorithm addresses them (advantages)
- Uses only integer arithmetic: decision parameter p_0 = 2Δy − Δx, with p_k+1 = p_k + 2Δy or p_k + 2Δy − 2Δx.
- No rounding and no accumulated error: the sign of p_k gives the closest pixel exactly.
- Faster and easy to implement in hardware, so it is used by most graphics systems.
✓ Answer checked by Claude Opus 5.5 (high effort)
Related questions
- Compare DDA/Bresenham; midpoint ellipse · Computer Graphics, chapter 2
- Write Bresenham's line algorithm · Computer Graphics, chapter 2 · asked 3×
- DDA algorithm with advantages · Computer Graphics, chapter 2
- Bresenham's algorithm for all slopes · Computer Graphics, chapter 2
- Bresenham: line (25,20) to (15,10) · Computer Graphics, chapter 2
- Bresenham: line (20,10) to (30,18) · Computer Graphics, chapter 2 · asked 4×
- Data types and classification of algorithms · Data Structure and Algorithm, chapter 1
- Secant algorithm, versus false position · Numerical Method, chapter 2
- Algorithm versus pseudo-code · Computer Programming, chapter 2
- Forward vs reverse engineering merits and demerits · Object Oriented Analysis and Design, chapter 4 · asked 3×