Content deleted Content added
ClueBot NG (talk | contribs) m Reverting possible vandalism by 112.133.203.58 to version by Mindmatrix. False positive? Report it. Thanks, ClueBot NG. (2030608) (Bot) |
|||
Line 19:
The DDA starts by calculating the smaller of dy or dx for a unit increment of the other. A line is then sampled at unit intervals in one coordinate and corresponding integer values nearest the line path are determined for the other coordinate.
Considering a line with
: <math>y_{k+1} = y_k + m</math>
Subscript k takes integer values starting from 0, for the 1st point and increases by 1 until endpoint is reached.
Line 27:
: <math>x_{k+1} = x_k + \frac{1}{m}</math>
Similar calculations are carried out to determine pixel positions along a line with negative slope. Thus, if the absolute value of the slope is less than 1, we set dx=1 if <math> x_{start}<x_{end}</math> i.e. the starting extreme point is at the left
== See also ==
|