1. DDA Line Algorithm
🎯 Line Equation
🎯 Line DDA Algorithm
The digital differential analyzer(DDA) is a scan conversion line algorithm based on your Dx calculation. The line at unit intervals is one coordinate and determines corresponding integer values nearest the line for the other coordinate.
Consider first a line with a positive slope.
If the slope is less than or equal to 1, the unit x intervals Dx=1 and compute each successive y value.
subscript k takes integer values starting from 1 for the first point and increments by one until the final end point is reached.
m->any real numbers between 0 and 1
Calculate y values must be rounded to the nearest integer
If the slope is greater than 1, the roles of x and y at the unit y intervals Dy=1 and compute each successive y value.
Equation 6 and Equation 7 that the lines are to be processed from the left endpoint to the right endpoint.
If the processing is reversed, the starting point at the right
Intervals Dy=1 and compute each successive y value.
Equation 6 and Equation 9 are used to calculate pixel position along a line with a negative slope.
Faster method for calculating pixel position than the equation of a pixel position. (Y=mx+b)
The accumulation of round of error is the successive addition of the floating point increments used to find the pixel position. Still, it takes a lot of time to compute the pixel position.