CGM Unit 2 Question Bank
CGM Unit 2 Question Bank
Question Bank
1. Describe in detail about the DDA line scan conversion algorithm.
The incremental technique is used in this algorithm.
It means that we can find the next coordinates by using past coordinates as a guide.
In this method, the difference of pixel point is analyzed and according to the analysis, the
line can be drawn.
We’ll start with the initial position and work our way to the ending position by looking for
intermediate places. The slope of the line will be the ratio of difference of y-coordinates and
the difference of x-coordinates.
Δy = m * Δx , Δx = Δy / m
The value of the slope will be either positive or negative. If the value of the slope is positive then
the values of Δx and Δy are increased otherwise their values are decreased.
7. Digitize a line from (10, 12) to (15,15) on a raster screen using Bresenham’s straight
line algorithm.
To illustrate the algorithm, we digitize the line with endpoints (20, 10) and (30, 18)
dx =10, dy =8
The initial decision parameter has the value: p = 20dy – dx = 6 and the increments for calculating
We plot the initial point = (20, 10), and determine successive pixel positions along the line path from the
8. Using the DDA algorithm digitize a line with end points (10,15) and (15,30).
9. Digitize a line with end points (20, 10) and (30, 18) using DDA line drawing Algorithm.
10. Implement the DDA algorithm to draw a line from (0,0) to (6,6).
11. Draw the line using simple DDA and point of line are (8,5) and (13,12).
Certainly! Here's how to solve the problem of drawing a line using the DDA algorithm with points (8, 5) and
(13, 12), along with the mathematical explanation:
The DDA algorithm leverages the concept of incremental steps to trace a line between two points. In each
step, we move a small distance in both x and y directions based on their relative changes (dx and dy). The
step size is determined by the larger change in x or y to ensure we reach the endpoint in equal steps.
The DDA formula for calculating the next point coordinates is:
x_next = x + Δx
y_next = y + Δy
This formula essentially adds the step size in x and y directions to the current coordinates to reach the next
point along the line.
Points generated:
By following these steps, you'll calculate the following points along the line:
(8, 5), (8.71, 6), (9.43, 7), (10.14, 8), (10.86, 9), (11.57, 10), (12.29, 11), (13, 12)
This set of points represents the discrete approximation of the line segment between (8, 5) and (13, 12).
12. Draw the line using simple DDA and point of line are (0,0) and (10,5).
Solving the line drawing using DDA algorithm for points (0, 0) and (10, 5):
Here's the solution for drawing the line using the DDA algorithm with points (0, 0) and (10, 5):
By following these steps, you'll calculate the following points along the line:
(0, 0), (1, 0.5), (2, 1), (3, 1.5), (4, 2), (5, 2.5), (6, 3), (7, 3.5), (8, 4), (9, 4.5), (10, 5)
These points represent the discrete approximation of the line segment between (0, 0) and (10, 5) using the
DDA algorithm.
13. Consider the line from (5,5) and (13,9). Use the Bresenham’s algorithm to rasterize the line.
14. Consider the line from (0,0) and (6,7). Use the Bresenham’s algorithm to rasterize the line.
15. Consider the line from (1,2) and (3,10). Use the Generalized Bresenham’s algorithm
torasterize the line.
16. Consider the line from (-3,3) and (4,-4). Use the Generalized Bresenham’s algorithm
torasterize the line.
29. Consider the line from (0,0) and (-6,6). Use the Bresenham’s algorithm to rasterize the line.
30. Find the pixel position approximating the first octant of a circle having a center (2,3) and
aradius of 2 units, using bresenhams circle algorithm.
31. Plot a circle at (5,5) having a radius of 5 units using mid-point circle algorithm.
32. Plot a circle at (2,5) having a radius of 7 units using mid-point circle algorithm.
33. Find the pixel position approximating the first octant of a circle having a center (2,3) and
aradius of 2 units, using Bresenhams circle algorithm.
34. Find the pixel position approximating the first octant of a circle having a center (10,13)
anda radius of 5 units, using Bresenhams circle algorithm.
35. Apply DDA circle algorithm plot a circle on origin whose radius 10 units.