#include #include #include #include struct POINT { int x,y; }; void linetheta(float ang, float l, float *x,float *y){ float k1,k2,rad=3.14159/180; k1=l*cos(ang*rad); k2=l*sin(rad*ang); *x+=k1; *y+=k2; lineto(*x,*y); } void main() { int Drv,mode,i,j,c; struct POINT p1; float sta,ang,x,y,ol,l,n; char aa; printf("give me the circulus point -->"); scanf("%d %d",&p1.x,&p1.y); printf("give me the length of line -->"); scanf("%f",&l); ol=l; printf("give me the decrement -->"); scanf("%f",&n); printf("give me the starting angle -->"); scanf("%f",&ang); Drv=DETECT; initgraph(&Drv,&mode,""); c=1; while (1) { c=(c+2)%16; l=ol; sta=0.0; setcolor(c); x=p1.x; y=p1.y; moveto(x,y); c=(c+1)%16; while (l > 10.0) { setcolor(c); linetheta(sta,l,&x,&y); sta=fmod(sta+ang,360.0); l-=n; c=(c+1)%16; } while ((aa=kbhit()) != 0) break; if (aa != 0) break; } getche(); closegraph(); }