#include #include #include #include void main() { int GraphDriver; /* The Graphics device driver */ int GraphMode; /* The Graphics mode value */ struct point { int x,y; } p1,p2; int k,i,m,j; char aa; float x,y,rad=3.14159/180; printf("give me the circle point--->"); scanf("%d %d",&p1.x,&p1.y); printf("give me the k --->"); scanf("%d",&k); getche(); m=k; j=1; GraphDriver = DETECT; /* Request auto-detection */ initgraph( &GraphDriver, &GraphMode, "" ); /* just increasing p1 - p2 */ while (1) { while (m > 30 ) { for (i=0; i<=360; i++) { x=p1.x+m*(1+cos(i*rad))*cos(i*rad); y=p1.y+m*(1+cos(i*rad))*sin(i*rad); if (i == 0) moveto(x,y); else lineto(x,y); } m-=10; setcolor((j++)%15); } m=k; while ((aa=kbhit())!= 0) break; if (aa != 0) break; } getche(); closegraph(); /* Return the system to text mode */ }