/*Program to implement 2-D transformations */ #include #include #include #include #include #include #define PI 3.14 float cord[10][3]; int n; void myclrscr() { int gdriver = DETECT, gmode; initgraph(&gdriver, &gmode, ""); } void getPoints() { int i; printf("Enter the no of defining vertices: "); scanf("%d",&n); for(i=0;i>choice; switch(choice) { case 1 : printf("Enter the translating co-ordinates:"); scanf("%f %f",&tx,&ty); myclrscr(); translate(tx,ty,1); break; case 2 : printf("Enter the Scaling factors:"); scanf("%f %f",&sx,&sy); printf("Enter the refrence co-ordinates: "); scanf("%f %f",&xf,&yf); myclrscr(); scale(sx,sy,xf,yf); break; case 3: printf("Enter the Rotating angle :"); scanf("%f",&r); printf("Enter the refrence co-ordinates: "); scanf("%f %f",&xf,&yf); myclrscr(); rotate(r,xf,yf); break; case 0 : exit(0); getch(); } } getch(); }