Retour

Source : saisons1B.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.

saisons1B.mp
%@AUTEUR: Jean-Michel Sarlat
 
verbatimtex
%&latex
\documentclass{article}
\usepackage{fourier}
\begin{document}
etex
 
 
input fichierps;
InitFichierPS(-116,-116,116,116);
 
input legendes;
picture legende;
legende := image(
	legendeCCO(origin,
	    1,
	    (0.5,0.5,0.1),
	    (0.4,0.4,0.4),
	    4,
	    (2,-2),
	    btex Mouvement du soleil en longitude etex
	    );
	);
 
def Pointe(expr x,p) =
    fill fullcircle scaled x shifted p
enddef;
 
 
% excentricité, demi-grand axe, demi-petit axe
numeric e,a,b;
e = 0.4;
a = 100;
b = a * sqrt(1 - e * e) ;
path cp,el;
% cercle principal
cp = fullcircle scaled 2a;
% ellipse 
el = fullcircle xscaled 2a yscaled 2b;
 
for i=1 upto 80:
    beginfig(i);
	numeric t;
	t = i/10;
	pair S,S',T,O;
 
	% soleil réel
	S = point t of el;
 
	% soleil déplacé
	S'= point t of cp;
 
	% terre
	T = (sqrt(a**2-b**2),0);
 
	% origine du cercle principal
	O = (0,0);
 
	% fond
	fill (-1.15a,-1.15a) 
	    -- (1.15a,-1.15a)
	    -- (1.15a,1.15a)
	    -- (-1.15a,1.15a)
	    -- cycle withcolor (.8,.8,1);
 
	% axes
	draw (-1.15a,0) -- (1.15a,0);
	draw (0,-1.15a) -- (0,1.15a);
 
	draw cp withcolor (.5,.5,.5);
	draw el withpen pencircle scaled 1.5pt withcolor (.1,.1,.6);
 
	draw S'--(xpart S',0) 
	    withpen pencircle scaled 0.4 
	    withcolor 0.6*white;
 
	draw O--S' withpen pencircle scaled 0.5;
	draw T--S  withpen pencircle scaled 0.5;
 
	path t[];
	t1 = (fullcircle scaled 20) cutafter (O--S');
	t2 = ((fullcircle scaled 20) shifted T) cutafter (T--S);
	drawarrow t1;
	drawarrow t2;
 
 
	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);
 
	Pointe(3,S') withcolor green;
	Pointe(3,(-a,1.05a)) withcolor green;
	label.rt(btex $S'$ etex,(-a+5,1.05a));
 
	Pointe(5,S) withcolor (1,1,0);
	Pointe(5,(-a,0.95a)) withcolor (1,1,0);
	label.rt(btex $S$ etex,(-a+5,0.95a));
 
	label.bot(btex $T$ etex,T);
	Pointe(4,T)  withcolor (.5,.3,.2);
 
	label.ulft(btex $A$ etex,(-a,0));
	label.llft(btex $B$ etex,(0,b));
	label.urt(btex $P$ etex,(a,0));
	Pointe(4,O) withcolor 0.5*white;
 
	draw legende shifted (0,-0.4a);
    endfig;
endfor;
 
end