Le problème des deux corps : mouvements dans le repère inertiel, explications du...
[pst-eqdf.git] / gravitation / pb_2corps_part2_animation.tex
diff --git a/gravitation/pb_2corps_part2_animation.tex b/gravitation/pb_2corps_part2_animation.tex
new file mode 100644 (file)
index 0000000..480dc39
--- /dev/null
@@ -0,0 +1,266 @@
+\r
+\documentclass{article}\r
+\usepackage[a4paper,margin=2cm]{geometry}\r
+\usepackage{pst-eqdf,pst-node,pst-tools}\r
+\usepackage{animate}\r
+\pagestyle{empty}\r
+%timeline\r
+\begin{filecontents}{pb2corps.dat}\r
+::0x0\r
+::1\r
+::2\r
+::3\r
+::4\r
+::5\r
+::6\r
+::7\r
+::8\r
+::9\r
+::10\r
+::11\r
+::12\r
+::13\r
+::14\r
+::15\r
+::16\r
+::17\r
+::18\r
+::19\r
+::20\r
+::21\r
+::22\r
+::23\r
+::24\r
+::25\r
+::26\r
+::27\r
+::28\r
+::29\r
+::30\r
+::31\r
+::32\r
+::33\r
+::34\r
+::35\r
+::36\r
+::37\r
+::38\r
+::39\r
+::40\r
+::41\r
+::42\r
+::43\r
+::44\r
+::45\r
+::46\r
+::47\r
+::48\r
+::49\r
+::50\r
+::51\r
+::52\r
+::53\r
+::54\r
+::55\r
+::56\r
+::57\r
+::58\r
+::59\r
+::60\r
+::61\r
+::62\r
+::63\r
+::64\r
+::65\r
+::66\r
+::67\r
+::68\r
+::69\r
+::70\r
+::71\r
+::72\r
+::73\r
+::74\r
+::75\r
+::76\r
+::77\r
+::78\r
+::79\r
+::80\r
+::81\r
+::82\r
+::83\r
+::84\r
+::85\r
+::86\r
+::87\r
+::88\r
+::89\r
+::90\r
+::91\r
+::92\r
+::93\r
+::94\r
+::95\r
+::96\r
+::97\r
+::98\r
+::99\r
+::100\r
+::101\r
+::102\r
+::103\r
+::104\r
+::105\r
+::106\r
+::107\r
+::108\r
+::109\r
+::110\r
+::111\r
+::112\r
+::113\r
+::114\r
+::115\r
+::116\r
+::117\r
+::118\r
+::119\r
+::120\r
+::121\r
+::122\r
+::123\r
+::124\r
+::125\r
+::126\r
+::127\r
+::128\r
+::129\r
+::130\r
+::131\r
+::132\r
+::133\r
+::134\r
+::135\r
+::136\r
+::137\r
+::138\r
+::139\r
+::140\r
+::141\r
+::142\r
+::143\r
+::144\r
+::145\r
+::146\r
+::147\r
+::148\r
+::149\r
+::150\r
+::151\r
+::152\r
+::153\r
+::154\r
+::155\r
+::156\r
+::157\r
+::158\r
+::159\r
+::160\r
+::161\r
+::162\r
+::163\r
+::164\r
+::165\r
+::166\r
+::167\r
+::168\r
+::169\r
+::170\r
+::171\r
+::172\r
+::173\r
+::174\r
+::175\r
+::176\r
+::177\r
+::178\r
+::179\r
+::180\r
+::181\r
+::182\r
+::183\r
+::184\r
+::185\r
+::186\r
+::187\r
+::188\r
+::189\r
+::190\r
+::191\r
+::192\r
+::193\r
+::194\r
+::195\r
+::196\r
+::197\r
+::198\r
+::199\r
+::200\r
+\end{filecontents}\r
+%%%%%%%%%%%%%%%%%%\r
+\title{Gravitation : le problème des deux corps avec PSTricks\\ partie 2}\r
+\date{5 juillet 2\,012}\r
+\begin{document}\r
+\begin{center}\r
+\pstVerb{/XY1 [(XYM1.dat) run] def\r
+         /XY2 [(XYM2.dat) run] def\r
+         /XYG [(XYG.dat) run] def}%\r
+\def\nFrames{200}% 200 images\r
+\begin{animateinline}[controls,loop,timeline=pb2corps.dat,%\r
+                     begin={\begin{pspicture}(-4,-5)(13,12)},\r
+                     end={\end{pspicture}}]{10}% 10 images/s\r
+\psframe*(-4,-5)(13,12)\r
+\psgrid[subgriddiv=0,gridcolor=white,griddots=10,gridlabels=0pt]%\r
+\listplot[linecolor=gray]{XY1 aload pop}\r
+\listplot[linecolor=gray]{XY2 aload pop}\r
+\listplot[linecolor=gray]{XYG aload pop}\r
+\newframe\r
+\multiframe{\nFrames}{i=0+10,I=2+10}{% 1 point sur 10\r
+\pstVerb{/X1 XY1 \i\space get def\r
+         /Y1 XY1 \i\space 1 add get def\r
+         /X2 XY2 \i\space get def\r
+         /Y2 XY2 \i\space 1 add get def\r
+         /XG XYG \i\space get def\r
+         /YG XYG \i\space 1 add get def\r
+     /xy1 [\r
+         0 2 \I\space {/i exch def\r
+         XY1 i get\r
+          XY1 i 1 add get\r
+        } for\r
+         ] def\r
+     /xy2 [\r
+         0 2 \I\space {/i exch def\r
+         XY2 i get\r
+         XY2 i 1 add get\r
+        } for\r
+         ] def\r
+     /xyG [\r
+         0 2 \I\space {/i exch def\r
+         XYG i get\r
+         XYG i 1 add get\r
+        } for\r
+         ] def\r
+}%\r
+\psgrid[subgriddiv=0,gridcolor=white,griddots=10,gridlabels=0pt]%\r
+\listplot[linecolor=red]{xy1 aload pop}\r
+\listplot[linecolor=blue!50]{xy2 aload pop}\r
+\listplot[linecolor=yellow]{xyG aload pop}\r
+\pscircle*[linecolor=red](!X1 Y1){0.3}\r
+\pscircle*[linecolor=blue!50](!X2 Y2){0.1}\r
+\pscircle*[linecolor=yellow](!XG YG){0.05}\r
+%\psline[linestyle=dashed,linecolor=white](!X1 Y1)(!X2 Y2)\r
+}\r
+\end{animateinline}\r
+\end{center}\r
+\end{document} 
\ No newline at end of file

Licence Creative Commons Les fichiers de Syracuse sont mis à disposition (sauf mention contraire) selon les termes de la
Licence Creative Commons Attribution - Pas d’Utilisation Commerciale - Partage dans les Mêmes Conditions 4.0 International.