Aim: To Write A C Graphics Program For Translation of Rectangle
The document describes a C graphics program to translate a rectangle. It includes functions to draw a rectangle given coordinates, translate the rectangle by adding offsets to the coordinates, and a main function to get user input for the initial rectangle coordinates, draw the rectangle, translate it, and redraw it. The rectangle drawing function uses lines to connect the points of the rectangle. The translation function gets new x and y offsets from the user, clears the screen, adds the offsets to the original coordinates, and redraws the rectangle.
Download as DOCX, PDF, TXT or read online on Scribd
Download as docx, pdf, or txt
0 ratings0% found this document useful (0 votes)
711 views2 pages
Aim: To Write A C Graphics Program For Translation of Rectangle
The document describes a C graphics program to translate a rectangle. It includes functions to draw a rectangle given coordinates, translate the rectangle by adding offsets to the coordinates, and a main function to get user input for the initial rectangle coordinates, draw the rectangle, translate it, and redraw it. The rectangle drawing function uses lines to connect the points of the rectangle. The translation function gets new x and y offsets from the user, clears the screen, adds the offsets to the original coordinates, and redraws the rectangle.