在照明技巧中,有 2 种算法规则用于在屏幕上绘制一条线,即DDA代表数字差分分析仪算法规则和 Bresenham 线算法。
DDA 算法和 Bresenham 线算法的主要区别在于,DDA 算法规则使用浮动目的值,而在 Bresenham 中,使用球形关闭函数。
DDA 算法规则涉及乘法和除法,而在 bresenham 算法规则中,加法和减法是执行最多的运算。
我们来看看DDA算法和Bresenham画线算法的区别:
S.NO | DDA Line Algorithm | Bresenham line Algorithm |
---|---|---|
1. | DDA stands for Digital Differential Analyzer. | While it has no full form. |
2. | DDA algorithm is less efficient than Bresenham line algorithm. | While it is more efficient than DDA algorithm. |
3. | The calculation speed of DDA algorithm is less than Bresenham line algorithm. | While the calculation speed of Bresenham line algorithm is faster than DDA algorithm. |
4. | DDA algorithm is costlier than Bresenham line algorithm. | While Bresenham line algorithm is cheaper than DDA algorithm. |
5. | DDA algorithm has less precision or accuracy. | While it has more precision or accuracy. |
6. | In DDA algorithm, the complexity of calculation is more complex. | While in this, the complexity of calculation is simple. |
7. | In DDA algorithm, optimization is not provided. | While in this, optimization is provided. |