NOTES
Here covering topics are: 1. Straight line equation, 2. DDA, 3. Bresenham line Equation of a straight line - m= (y2 - y1) / (x2-x1) = ∆y/ ∆x ∆y = m. ∆x ∆x= ∆y / m m = slope x,y = co-ordinate c= constant here. DDA Algorithm (Digital Differential Analyzer)- DDA is a scan conversion line drawing algorithm based on calculating either ∆y or ∆x. If the slope is less than or equals to 1 (m<=1), we sample at unit x interval( ∆x = 1) and compute each successive y value as yk+1 = yk + m. Since m can be any real number between 0 and 1, the calculated y value must be rounded to nearest integer. For lines with a positive slope greater than 1 (m>1), we sample at unit y interval( ∆y = 1) and calculate xk+1 = xk + 1/m . Advantage: 1. It is simple and easy to understand. 2. This method does not use multiplication theorem. Disadvantage: 1. It involves floating point additions. 2. Rounding off operations and floating point operations consume...