Digital differential analyzer (graphics algorithm): Difference between revisions

Content deleted Content added
m Reverted edits by 122.161.201.118 (talk): Editing tests (HG)
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 positive slope, if the slope is less than or equal to 1,jha ha kuata we sample at unit x intervals (dx=1) and compute successive y values as
: <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.