Discussion
Which of the following points lies over the line when Bresenham's line drawing algorithm is used to draw the line between the points (4, 6) and (15, 12) ?
Answer: D
The point on the line is (13, 11).
From (4, 6) to (15, 12): \(\Delta x = 11\), \(\Delta y = 6\), so the slope is below 1 and x steps by 1. The decision parameter starts at \(p_0 = 2\Delta y - \Delta x = 1\). If \(p \ge 0\), y increases and \(p\) changes by \(2\Delta y - 2\Delta x = -10\); otherwise y stays and \(p\) changes by \(2\Delta y = 12\).
| x | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 |
|---|---|---|---|---|---|---|---|---|---|
| y | 7 | 7 | 8 | 8 | 9 | 9 | 10 | 10 | 11 |
So the plotted points include (5, 7), (7, 8), (11, 10) and (13, 11). The options (5, 6), (7, 7) and (11, 9) each lie one pixel below the line.
Post your comment
Please log in or register to post a comment.
Examination Categories
- SSC Exams
- Banking Exams
- Teaching Exams
- Civil Services Exams
- Railways Exams
- Engineering Recruitment Exams
- Defence Exams
- State Government Exams
- Police Exams
- Insurance Exams
- Nursing Exams
- Other Government Exams
- NRA CET
- PG Entrance Exams
- Campus Placement
- MBA Entrance Exams
- CUET and UG Entrance
- Judiciary Exams
- Regulatory Body Exams
- Software Development