Retour

Source : saisons2B.mp

Animation flash


Cette animation flash est produite à partir d'une série de figures générées par le code MetaPost ci-dessous.
Deux fichiers de macros fichierps.mp et legendes.mp sont nécessaires pour la compilation.

saisons2B.mp
verbatimtex
%&latex
\documentclass{article}
\usepackage[latin1]{inputenc}
\usepackage[frenchb]{babel}
\usepackage{fourier}
\begin{document}
etex
 
input fichierps;
InitFichierPS(-116,-125,116,134);
 
% excentricité, demi-grand axe, demi-petit axe
numeric e,a,b,M,u;
e = 0.2;
a = 100;
b = a * sqrt(1 - e * e) ;
 
path cp,el;
% cercle principal
cp = fullcircle scaled 2a;
 
% ellipse
el = fullcircle xscaled 2a yscaled 2b;
 
pair S,S',S'',T,O;
 
% équation de Kepler par itérations
numeric dr;
dr := 0.0174833;
vardef kepler(expr m) =
    save u,ed;
    numeric u,ed;
    ed := e * 57.29578; % l'excentricité pour un calcul en degrés
    u := m;
    for i=1 upto 5: u := m + ed * sind(u); endfor;
    u
enddef;
 
for j:=1 upto 40:
    k := j/5;
    beginfig(j);
 
	% anomalie moyenne
	M   := k * 45;
 
	% soleil moyen
	S'' := point k of cp;
 
	% anomalie excentrique
	u   := kepler(M);
 
	% soleil déplacé
	S'  := point (u/45) of cp;
 
	% soleil vrai
	S   := S' yscaled (b/a);
 
	% terre
	T = (sqrt(a**2-b**2),0);
 
	% origine du cercle principal
	O = (0,0);
 
	fill el withcolor .9white;
	fill (el cutafter S)--T--cycle withcolor (.8,.8,1);
 
	% axes
	draw (-1.15a,0) -- (1.15a,0);
	draw (0,-1.15a) -- (0,1.15a);
 
	draw cp;
 
	draw el;
	draw O--S';
	draw T--S;
 
	path t[];
	t1 = (fullcircle scaled 20) cutafter (O--S');
	t2 = ((fullcircle scaled 20) shifted T) cutafter (T--S);
	drawarrow t1;
	drawarrow t2;
 
	label.rt(btex Soleil moyen ($M$)etex,(-1.05a,a));
	fill fullcircle scaled 7 shifted (-1.1a,a) withcolor (1,0,0);
	label.rt(btex Soleil excentré ($u$)etex,(-1.05a,-a));
	fill fullcircle scaled 6 shifted (-1.1a,-a) withcolor (1,.5,0);
 
	dotlabel.lrt(btex $T$ etex, T);
 
	% dotlabel.ulft(btex $A$ etex, (-a,0));
	% dotlabel.llft(btex $B$ etex, (0,b));
	dotlabel.urt(btex $P$ etex, (a,0));
	label.llft(btex $x$ etex, (1.1a,0));
	label.llft(btex $y$ etex, (0,1.1a));
	% label.lft(btex $b$ etex, (0,a/2));
	% label.top(btex $a$ etex, (-a/2,0));
	label.urt(btex $u$ etex,point 1 of t1);
	label.urt(btex $v$ etex,point 1 of t2);
	dotlabel.llft(btex $O$ etex, O);
 
	fill fullcircle scaled 5 shifted T  withcolor (.4,.3,.2);
	fill fullcircle scaled 5 shifted S  withcolor (1,1,0);
	fill fullcircle scaled 7 shifted S'' withcolor (1,0,0);
	fill fullcircle scaled 6 shifted S' withcolor (1,.5,0);
 
	fill (-1.15a,1.16a)--
    	    (1.15a,1.16a)--
    	    (1.15a,1.34a)--
    	    (-1.15a,1.34a)--cycle withcolor .9white;
 
	label(btex \bf Équation de Kepler: $u-e\sin u = M$ etex,(0,1.25a));
 
	fill (-1.15a,-1.16a) --
    	     (1.15a,-1.16a)  --
    	     (1.15a,-1.24a)  --
    	     (-1.15a,-1.24a) -- cycle withcolor .7*white;
 
	draw (-1.15a,-1.2a)--(1.15a,-1.2a);
	fill fullcircle scaled 7 shifted (0,-1.2a) withcolor (1,0,0);
	fill fullcircle scaled 6 shifted (2(u-M),-1.2a) withcolor (1,.5,0);
    endfig;
endfor;
end