5.0
Other
Digital Differential Analyzer or simply abbreviated as DDA line drawing algorithm is used for drawing lines in raster graphics devices. In this algorithm, the starting and end position of the line has to be supplied.
The intermediary pixel positions will be calculated by the linear interpolation of variables over an interval between the start and end points. The algorithm is as follows:
Let the start and end point of the line be (x1, y1) and (x2, y2), respectively. So slope, m= (y2-y1)/(x2-x1). Depending on the value of m and the Quadrant to which (x, y) belongs, intermediary pixel positions have to be calculated as follows:
The positions have to be calculated as follows:
Quadrant | m<=1 | m>1 |
No comment