2D Transformation
2D Transformation //C Program for 2D transformation : Translation ,Scaling , Rotation about origin and arbitrary point #include<graphics.h> #include<iostream> #include<math.h> #include<stdio.h> using namespace std; int gd=DETECT,gm,ch,exitp=0; float theta,sx,sy; int a,b[20],i,c[20],d[20],e[20],tx,ty,ax,ay; void translate(); void scale(); void rotate(); void quad(); void arotate(); int main() { cout<<"enter no points of poly"; cin>>a; cout<<" enter no of cordinates of polygon"; for (i=0;i<a*2;i++) { cin>>b[i]; if (i%2==0) c[i]=b[i]+320; else c[i]=240-b[i]; } c[i]=c[0]; c[i+1]=c[1]; cout<<" please enter choice 1:Translation 2:scaling 3:Rotation about origin 4:Rotation about arbitary point"; cin>>ch; switch(ch) { case 1: cout<<"enter x and y translation"; cin>>tx>>ty; quad(); translate(); break; case 2: cout<<"enter x and y Scaling"; cin>>sx>...