Computer Graphics Lab Practicals
1. Write a C program to implement the Digital Differential Analyzer (DDA) line drawing
algorithm. The program should accept two endpoints of a line segment as input and
display the line using graphics functions.
2. Write a C program to draw a closed polygon (triangle or rectangle) by using the DDA
algorithm for each edge. The coordinates of the vertices should be taken as input from
the user.
3. Write a C program using the DDA algorithm to draw these (accept endpoints and style
choice as user input):
○ a solid line
○ a dashed line
4. Write a C program to generate an integer grid (like graph paper) using horizontal and
vertical lines with the DDA algorithm. The size of the grid should be input by the user.