- Digital differential analyzer (graphics algorithm)
-
This article is about a graphics algorithm. For the digital implementation of a Differential Analyzer, see Digital Differential Analyzer.
In computer graphics, a hardware or software implementation of a digital differential analyzer (DDA) is used for linear interpolation of variables over an interval between start and end point. DDAs are used for rasterization of lines, triangles and polygons. In its simplest implementation the DDA algorithm interpolates values in interval [(xstart, ystart), (xend, yend)] by computing for each xi the equations xi = xi−1+1/m, yi = yi−1 + m, where Δx = xend − xstart and Δy = yend − ystart and m = Δy/Δx
Contents
Performance
The DDA method can be implemented using floating-point or integer arithmetic. The native floating-point implementation requires one addition and one rounding operation per interpolated value (e.g. coordinate x, y, depth, color component etc.) and output result. This process is only efficient when an FPU with fast add and rounding operation is available.
The fixed-point integer operation requires two additions per output cycle, and in case of fractional part overflow, one additional increment and subtraction. The probability of fractional part overflows is proportional to the ratio m of the interpolated start/end values.
DDAs are well suited for hardware implementation and can be pipelined for maximized throughput.
where m represents the slope the line and c is the y intercept . this slope can be expressed in DDA as
yend-ystart m= ----------- xend-xstart
in fact any two consecutive point(x,y) laying on this line segment should satisfy the equation.
See also
- Bresenham's line algorithm is an algorithm for line rendering.
- Xiaolin Wu's line algorithm is an algorithm for line anti-aliasing
References
Literature
- Alan Watt: 3D Computer Graphics, 3rd edition 2000, p. 184 (Rasterizing edges). ISBN 0-201-39855-9
Categories:- Computer graphics algorithms
- Digital geometry
Wikimedia Foundation. 2010.