Digital differential analyzer (graphics algorithm): Difference between revisions

Content deleted Content added
Tags: Mobile edit Mobile app edit
m Reverted 1 edit by 2405:204:E007:FEEA:D572:8E27:9BA9:A678 (talk) to last revision by Magic links bot. (TW)
Line 19:
 
== Algorithm ==
A linear DDA startedstarts 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, we sample at unit x intervals (dx=1) and compute successive y values as