#include #include #include #include #include #include int t1,t2,vx[100],vy[100]; void desen(int t1,int t2); void main(void) { // MERGE cu : 0.2,0.3;0.5,0.3;0.4,0.9;0.1,0.9; int gd,gm,i; float a,b,arg,val1,val2; clrscr(); //cleardevice(); //randomize(); printf("a si b"); scanf("%f %f",&a,&b); t1=0; t2=ceil(10*M_PI*10); for(i=t1;i<=t2;i++) { arg=i/10.0; val1=b*arg/a; val2=arg+b*arg/a; vx[i]=ceil(((a+b)*cos(val1)-b*cos(val2))*60)+150; vy[i]=ceil(((a+b)*sin(val1)-b*sin(val2))*60)+150; } detectgraph(&gd,&gm); initgraph(&gd,&gm,"C:\\borlandc\\bgi"); cleardevice(); moveto(120,150); lineto(180,150); moveto(150,120); lineto(150,180); desen(t1,t2); getch(); // closegraph(); } void desen(int t1,int t2) { int i; moveto(vx[0],vy[0]); for (i=t1+1;i<=t2;i++) { lineto(vx[i],vy[i]); delay(20); } }