Digital differential analyzer (graphics algorithm): Difference between revisions

Content deleted Content added
No edit summary
No edit summary
Line 1:
{{Cleanup|date=August 2007}}{{Refimprove|date=August 2007}}{{context}}
 
In [[Computer graphics]], '''Digital Differential Analyzer (DDA)''' is used for generating pixels using a line formed by two points. It employees 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.
 
The DDA method is not very efficient due to the need for division and rounding. [[Bresenham's line algorithm]] is a more efficient method to draw lines becouse it uses only addition, subtraction and bit shifting.
 
== Sample Code ==