Title: Comparative analysis of DDA algorithm and Bresenham algorithm
Authors: Ya-xin Zhang; Kang-ru Zhang; Chuan-hao Wu; Gui-ping Ge; Yong-an Xu
Addresses: College of Information Engineering (Artificial Intelligence), Yangzhou University, Yangzhou Jiangsu 225009, China ' College of Information Engineering (Artificial Intelligence), Yangzhou University, Yangzhou Jiangsu 225009, China ' College of Hydraulic Science and Engineering, Yangzhou University, Yangzhou Jiangsu 225009, China ' College of Information Engineering (Artificial Intelligence), Yangzhou University, Yangzhou Jiangsu 225009, China ' College of Information Engineering (Artificial Intelligence), Yangzhou University, Yangzhou Jiangsu 225009, China
Abstract: The straight line segment is the basic graphic element, and its generation algorithm has a great influence on the generation speed of complex graphics. In the past, the efficiency of integer operation is higher than that of floating-point operation, and the complexity of DDA algorithm is mainly floating-point addition and rounding operation, and the complexity of Bresenham algorithm is mainly integer operation through further improvement. Therefore, it is clearly explained in the existing computer graphics textbooks that the efficiency of Bresenham algorithm is higher than that of DDA algorithm. Through experiments, endpoints of 1,000 to 10,000 straight line segments are randomly generated, and the runtime of Bresenham algorithm and DDA algorithm is compared. It is found that the efficiency of DDA algorithm is higher than that of Bresenham algorithm. Then, by combining the comparison of the efficiency of modern CPU for addition, multiplication and division of integer and floating point with the improvement of floating-point computing hardware and instruction set in modern CPU, the computer's floating-point computing capabilities have been greatly improved, thus making the DDA algorithm more efficient than the Bresenham algorithm.
Keywords: DDA algorithm; Bresenham algorithm; floating point operation; integer operation; instruction set.
DOI: 10.1504/IJIITC.2022.129113
International Journal of Intelligent Internet of Things Computing, 2022 Vol.1 No.4, pp.263 - 272
Received: 29 May 2021
Accepted: 01 Oct 2021
Published online: 20 Feb 2023 *