C program for scaling of 2D object.

Posted by Mangesh on May 03, 2018

/* program for scaling 2D object. */

Description :

When we say we want to scale some 2D object, it means we want to increase the size of every object on screen.

Program :

void main() {
   int gdriver = DETECT, gmode;
   int point[] = {70,70,70,80,100,80,70,70};
   int i,sx,sy;
   initgraph(&gdriver, &gmode, "c:\\turboc3\\bgi");
   printf("\n\nEnter the scaling factor of X - axis : ");
   printf("Enter the scaling 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.