import graph; import animate; import geometry_dev; settings.tex="pdflatex"; settings.outformat="pdf"; size(15cm,0); animation A; real Rst=20, Rl=0.7, Rtl=5; real ast=20, est=0.3, bst=ast*sqrt(1-est^2), cst=ast*est; real atl=5, etl=0.8, btl=atl*sqrt(1-etl^2), ctl=atl*etl; real xST(real t) {return ast*cos(t)+cst;} real yST(real t) {return bst*sin(t);} real zST(real t) {return 0;} real xTL(real t) {return atl*cos(27*t);} real yTL(real t) {return btl*sin(27*t);} real zTL(real t) {return 0;} real xLl(real t) {return Rl*cos(27*t);} real yLl(real t) {return Rl*sin(27*t);} real zLl(real t) {return 0;} real xTt(real t) {return Rtl*cos(100*(t))/5;} real yTt(real t) {return Rtl*sin(100*(t))/5;} real zTt(real t) {return 0;} real xl(real t) {return xST(t)+xTL(t)+xLl(t);} real yl(real t) {return yST(t)+yTL(t)+yLl(t);} real zl(real t) {return 0;} real xt(real t) {return xST(t)+xTt(t);} real yt(real t) {return yST(t)+yTt(t);} real zt(real t) {return 0;} real xL(real t) {return xST(t)+xTL(t);} real yL(real t) {return yST(t)+yTL(t);} real zL(real t) {return 0;} pair SC=(0,0); picture pic; draw(pic,graph(xl,yl,0,2*pi,1000),gray); draw(pic,graph(xL,yL,0,2*pi,1000),lightgray+dashed); draw(pic,graph(xt,yt,0,2*pi,3000),royalblue); draw(pic,graph(xST,yST,0,2*pi,1000),mediumblue+dashed); int n=300; real step=2*pi/n; for(int i=-89; i<89; ++i) { real k=i*step; pair TC=(xST(k),yST(k)); line dT=perpendicular(TC,line(SC,TC)); pair [] tabpts=intersectionpoints(dT,circle((xST(k),yST(k)),Rtl/5)); pair ptA=tabpts[0], ptB=tabpts[1]; path lune=circle((xL(k),yL(k)),Rl); path soleil=circle((0,0),Rtl/2); path terre=circle((xST(k),yST(k)),Rtl/5); path demiTerre=arc(TC,ptA,ptB,CW); path demiTerreB=arc(TC,ptA,ptB,CCW); path diametreTerre=(2*ptA-ptB)--(2*ptB-ptA); path diametreTerreB=(2*ptB-ptA)--(2*ptA-ptB); path terreLum=buildcycle(diametreTerreB,demiTerre); path terreOmbre=buildcycle(diametreTerreB,demiTerreB); save(); add(pic); filldraw(terre,heavyblue); filldraw(soleil,yellow); filldraw(lune,lightgray); filldraw(terreLum,lightblue); draw(TC--(xt(k),yt(k)),white,Arrow); dot((xl(k),yl(k)),3bp+gray); dot((xt(k),yt(k)),3bp+white); A.add(); restore(); } for(int i=90; i<211; ++i) { real k=i*step; pair TC=(xST(k),yST(k)); line dT=perpendicular(TC,line(SC,TC)); pair [] tabpts=intersectionpoints(dT,circle((xST(k),yST(k)),Rtl/5)); pair ptA=tabpts[0], ptB=tabpts[1]; path lune=circle((xL(k),yL(k)),Rl); path soleil=circle((0,0),Rtl/2); path terre=circle((xST(k),yST(k)),Rtl/5); path demiTerre=arc(TC,ptA,ptB,CW); path demiTerreB=arc(TC,ptA,ptB,CCW); path diametreTerre=2*(1.5*ptA-ptB)--2*(1.5*ptB-ptA); path diametreTerreB=2*(1.5*ptB-ptA)--2*(1.5*ptA-ptB); path terreOmbre=buildcycle(diametreTerreB,demiTerre); path terreLum=buildcycle(diametreTerreB,demiTerreB); save(); add(pic); filldraw(terre,heavyblue); filldraw(soleil,yellow); filldraw(lune,lightgray); filldraw(terreLum,lightblue); draw(TC--(xt(k),yt(k)),white,Arrow); dot((xl(k),yl(k)),3bp+gray); dot((xt(k),yt(k)),3bp+white); A.add(); restore(); } label(A.pdf(BBox(2mm,Fill(black)),multipage=false));