C program to tramsform 2D objects.

Posted by Mangesh on May 03, 2018

/* program for transforming 2D object. */

Description :

Transforming a 2D object from one location to another can be done by adding the transforming factors to actual coordinates.

Program :

void main() {
   int gdriver = DETECT, gmode;
   int point[] = {50,50,50,200,200,200,50,50};
   int i,sx,sy;
   initgraph(&gdriver, &gmode, "c:\\turboc3\\bgi");
   printf("\n\nEnter the transform factor of X - axis : ");
   printf("Enter the transform factor of Y - axis : ");

       point[i] = point[i] + sx;
       point[i] = point[i] + sy;

Output :

 c program for transform 2d object output Executed and tested in Turbo C 3.2

Written with from Mangesh.

Related Post
1 C program for scaling of 2D object.
2 C program to tramsform 2D objects.
3 C program to draw a line.
4 C program to draw a circle.
5 C program to draw a rectangle.
6 C program for DDA algorithm to generate line.
7 C program for midpoint circle algorithm.
8 C program to draw a bar graph.
9 C program for bresenham's circle drawing algorithm.
Latest Post
1 shubhanshu
2 test
3 C program for Breadth First Search.
4 C program for Depth First Search(DFS).
5 C for circular queue using linked list.