#include #include #include #include float t[3][3]; void scale(float sx,float sy) { t[0][0]=sx; t[1][1]=sy; t[2][2]=1; t[0][1]=t[1][0]=t[0][2]=t[1][2]=t[2][0]=t[2][1]=0; } void tran_point(int oldx,int oldy,int *newx, int *newy) { *newx=(int)(t[2][0]+t[0][0]*oldx+t[1][0]*oldy); *newy=(int)(t[2][1]+t[0][1]*oldx+t[1][1]*oldy); } void main() { int GraphDriver; /* The Graphics device driver */ int GraphMode; /* The Graphics mode value */ struct point { int x,y; } p1,p4; int radius; float sx,sy,x,y,rad=3.14159/180,i,t; printf("give me the circle point--->"); scanf("%d %d",&p1.x,&p1.y); printf("give me the radius --->"); scanf("%d",&radius); printf("give me the scale (sx,sy)-->"); scanf("%f %f",&sx,&sy); getche(); GraphDriver = DETECT; /* Request auto-detection */ initgraph( &GraphDriver, &GraphMode, "" ); /* just increasing p1 - p2 */ setcolor(YELLOW); ellipse(p1.x,p1.y,0,360,radius,radius); getche(); setcolor(CYAN); scale(sx,sy); ellipse(p1.x,p1.y,0,360,radius*sx,radius*sy); getche(); closegraph(); /* Return the system to text mode */ }