- 2068 Chaitra · 8 marks
Bresenham: endpoints (10,18),(15,8)
Short answer
Use Bresenham's algorithm for |m|>1: start p0=0, update p by +10 if negative or -10 if nonnegative. The digitized pixels are (10,18), (11,17), (11,16), (12,15), (12,14), (13,13), (13,12), (14,11), (14,10), (15,9), (15,8).
Digitize the endpoint (10, 18), (15, 8) using Bresenham's algorithm.
Given: end points (10,18) and (15,8). Δx = 5, |Δy| = 10, the slope is m = −2 (|m| > 1, negative). So y decreases by 1 each step, and x either stays or increases by 1.
p0 = 2Δx − |Δy| = 10 − 10 = 0
p < 0: x same, p = p + 2Δx = p + 10
p ≥ 0: x + 1, p = p + 2Δx − 2|Δy| = p − 10
| k | p_k | (x_k, y_k) |
|---|---|---|
| 0 | 0 | (10,18) |
| 1 | -10 | (11,17) |
| 2 | 0 | (11,16) |
| 3 | -10 | (12,15) |
| 4 | 0 | (12,14) |
| 5 | -10 | (13,13) |
| 6 | 0 | (13,12) |
| 7 | -10 | (14,11) |
| 8 | 0 | (14,10) |
| 9 | -10 | (15,9) |
| 10 | 0 | (15,8) |
Answer: (10,18), (11,17), (11,16), (12,15), (12,14), (13,13), (13,12), (14,11), (14,10), (15,9), (15,8).
✓ Answer checked by Claude Opus 5.5 (high effort)
Related questions
- Bresenham: line (20,10) to (30,18) · Computer Graphics, chapter 2 · asked 4×
- Bresenham: line (10,20) to (15,2) · Computer Graphics, chapter 2 · asked 4×
- Bresenham: line (25,20) to (15,10) · Computer Graphics, chapter 2
- DDA versus Bresenham line algorithm · Computer Graphics, chapter 2 · asked 6×
- Write Bresenham's line algorithm · Computer Graphics, chapter 2 · asked 3×
- Bresenham's algorithm for all slopes · Computer Graphics, chapter 2
- Splice of 18 mm flats with M18 10.9 bolts · Design of Steel and Timber Structure, chapter 5
- 10 m cut in cohesive soil, bedrock 15 m · Soil Mechanics, chapter 11
- Laplace: 2x2 grid 10/15/20 · Numerical Method, chapter 7 · asked 6×
- Initial values with switch open to closed (10 Ω, 15 Ω, 2 F) · Electrical Circuit Theory, chapter 2