DDA Line Drawing Algorithm

DDA(Digital DIfferential Analyzer) is a simple line drawing algorithm.It is based on calculating the difference between x and y coordinates of two points and determining which of the two directions need more steps. #include<stdio.h> #include<conio.h> /*Header file for built-in graphics functions such as plot() and initgraph()*/ #include<graphics.h> #include<math.h> int round(float val) { return (int)(val+0.5); } […]

Continue reading


Bresenham’s Line Drawing Algorithm

The Bresenham algorithm is a basic line drawing algorithm. It uses only integer calculations. At every step,we move one unit in x direction and choose among two candidate points in y direction. #include<stdio.h> #include<conio.h> /*Header file for built-in graphics functions such as plot() and initgraph()*/ #include<graphics.h> /* Function To Implement Bresenham’s algorithm */ void line_bresenham(int […]

Continue reading