Digital differential analyzer (graphics algorithm): Difference between revisions

Content deleted Content added
Markzou (talk | contribs)
No edit summary
Markzou (talk | contribs)
No edit summary
Line 1:
DDA (digital differential analyzer) 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.
Here is a sample C code of the DDA implementation:
 
 
void line DDA(int xa, int ya, int xb, int yb)
Line 20 ⟶ 19:
setPixel(ROUND(x), ROUND(y));
}
 
}