Digital differential analyzer (graphics algorithm): Difference between revisions

Content deleted Content added
No edit summary
Line 4:
In [[Computer graphics]], '''Digital Differential Analyzer (DDA)''' is an algorithm used to determine which points need to be plotted in order to draw a straight line between two given points. It employs the equation for line representation (example: y=mx+c), then scan through an axis. Each scan it would determine the value on the other axis using the equation, this way the proper pixel can be located.
 
==Algorithm (Naïve Floating-Point Implementation)==
The straightforward implementation of the DDA algorithm requires a fast floating-point add and round() operation for good performance. Here an example in the [[C programming language]] interpolating a single value <code>x</code> between start and end point:<ref>inspired by Watt 2000, p. 184.</ref>
 
<code>