import hs_entete; import animate; animation A; size(10cm); zfct2 Ylm=Y(7,4); real F(real phi, real theta) { return 0.75+0.25*xpart(Ylm(phi,theta)); } pen surfacepen(real t, real p) { return interp(yellow,red, (F(t,p)-0.63)/(0.87-0.63)); } // Mettre ŕ true pour sortir en pdf. // Dans ce cas la compilation nécessite beaucoup plus de RAM. bool pdf=false; if(pdf) settings.outformat="pdf"; else A.global=false; int da=10; transform3 T; triple adir=(0,0,4); currentlight=(0,0,4); currentlight=(4,4,2); currentprojection=orthographic((4,2,2)); real M=0.210769451275276; int n=20; real step=1/n; picture hs(int i) { real l=i*step; real F(real phi, real theta) { real c=l+(1-l)*xpart(Ylm(phi,theta))^2/M; return c; } return sphericalsurface(F,(0,0),(pi,2pi), 60, surfacepen); } void fillsquare() { if(!pdf) fill(shift(-1.1,-1.1)*scale(2.2)*unitsquare,black); } picture pic; for(int i=0; i <= n; ++i) { save(); fillsquare(); pic=hs(i); add(pic); A.add(); restore(); } for (int i=0; i < 5; ++i) { save(); fillsquare(); add(pic); A.add(); restore(); } for(int i=n; i >= 0; --i) { real l=i*step; save(); fillsquare(); pic=hs(i); add(pic); A.add(); restore(); } A.movie(BBox(3mm,FillDraw(black)),keep=true);