#include #include #include #include #include void main(void) { int gd=DETECT,gm; /*First Number*/ double pxs0,vxs0,axs0; double pys0,vys0,ays0; /*double pzs0,vzs0,azs0 */; /*Sigma Number*/ double pxs,vxs,axs; double pys,vys,ays; /*double pzs,vzs,azs;*/ /*parameters*/ double speedtheta,speedbigth; double deltatimedays; double howlong,counter; /*constant numbers*/ double speedearth; speedearth = 2*3.141592/365.251; /*printf("%lf",speedearth ,"\n")*/; /*Unit is 1 AU*/; double gconst,sungravity; gconst=5.2/(100000000); sungravity=3.3*(100000)*gconst*speedearth; initgraph(&gd,&gm,"") ; /*=====*/; /*firstspeed-vector cerestron s*/; /*SpeedTheata*/; printf("\n vecter speed degree -180 to +180??\n"); scanf("%lf",&speedtheta); /*SpeedBigth*/; printf("\n speed-bigth 0 to 10 Unit is EarthSpeed?\n"); scanf("%lf",&speedbigth); pxs0=1; pys0=0; vxs0=speedearth*speedbigth*cos(2*3.141592*(speedtheta+90)/360); vys0=speedearth*speedbigth*sin(2*3.141592*(speedtheta+90)/360); /* printf("%lf %lf %lf",vxs0,vys0,speedearth)*/; /*time parameters*/ /*deltatimedays first:Nxet days of earth*/; deltatimedays=.25; printf("%lf",deltatimedays); printf("\n HOWLONG by years ?\n"); scanf("%lf",&howlong ); howlong=howlong*365.251; printf("%lf",howlong); /*moniter scale*/ int xmoni,ymoni; double ktemp; int howauperhalfxmoni; howauperhalfxmoni=5; ktemp = 640*.5/howauperhalfxmoni; xmoni=640;ymoni=480; circle(int(xmoni/2+.5),(int(ymoni/2-.5)),int(ktemp+.5)); int dotx,doty; /*======main core ==================================== counter is 0 than next; s:sigma-mean*/ pxs=pxs0;pys=pys0; vxs=vxs0;vys=vys0; /*printf("%lf",vys)*/; /*=================================================*/; double d,ax,ay; counter =0; stepagain:; /*== important core !!===============================*/ d=(pxs*pxs)+(pys*pys); /*printf("%lf",d,"\n")*/; ax=-sungravity*pxs/(d*sqrt(d)); ay=-sungravity*pys/(d*sqrt(d)); axs=ax; ays=ay; vxs=vxs+axs*deltatimedays; vys=vys+ays*deltatimedays; pxs=pxs+vxs*deltatimedays; pys=pys+vys*deltatimedays; /* =====Graphics======;*/ dotx=int(xmoni/2+ktemp*pxs+.5); doty=int(ymoni/2-ktemp*pys+.5); putpixel(dotx,doty,4); /*=====Graphics end======*/ if (howlong