--- /dev/null
+\r
+\documentclass{article}\r
+\usepackage[a4paper,margin=2cm]{geometry}\r
+\usepackage[T1]{fontenc}\r
+\usepackage[latin1]{inputenc}%\r
+\usepackage[garamond]{mathdesign}\r
+\usepackage{pst-eqdf,pst-node,pst-tools}\r
+\usepackage{array,amsmath}\r
+\usepackage{animate}\r
+\usepackage{wasysym}\r
+\newpsstyle{vecteurA}{arrowinset=0.05,arrowsize=0.1,linecolor={[rgb]{1 0.5 0}}}\r
+\newpsstyle{vecteurB}{arrowinset=0.05,arrowsize=0.1,linecolor={[rgb]{0 0.5 1}}}\r
+\newpsstyle{vecteurC}{arrowinset=0.1,arrowsize=0.2,linecolor={[rgb]{1 0 0}}}\r
+\makeatletter\r
+%% adapté de \psRandom du package pstricks-add\r
+%% pour rendre aléatoire la taille des étoiles\r
+%% Manuel Luque\r
+\newdimen\pssizeStar\r
+\def\psset@sizeStar#1{\pssetlength\pssizeStar{#1}}\r
+\psset@sizeStar{1pt}\r
+\define@key[psset]{pst-eqd}{randomPoints}[1000]{\def\psk@randomPoints{#1}}\r
+\psset[pst-eqd]{randomPoints=1000}\r
+\define@boolkey[psset]{pst-eqd}[Pst@]{color}[true]{}\r
+\psset[pst-eqd]{color=false}\r
+\def\psRandomStar{\pst@object{psRandomStar}}%\r
+\def\psRandomStar@i{\@ifnextchar({\psRandomStar@ii}{\psRandomStar@iii(0,0)(1,1)}}\r
+\def\psRandomStar@ii(#1){\@ifnextchar({\psRandomStar@iii(#1)}{\psRandomStar@iii(0,0)(#1)}}\r
+\def\psRandomStar@iii(#1)(#2)#3{%\r
+ \def\pst@tempA{#3}%\r
+ \ifx\pst@tempA\pst@empty\psclip{\psframe(#2)}\else\psclip{#3}\fi\r
+ \pst@getcoor{#1}\pst@tempA\r
+ \pst@getcoor{#2}\pst@tempB\r
+ \begin@SpecialObj\r
+ \addto@pscode{\r
+ \pst@tempA\space /yMin exch def\r
+ /xMin exch def\r
+ \pst@tempB\space /yMax exch def\r
+ /xMax exch def\r
+ /dy yMax yMin sub def\r
+ /dx xMax xMin sub def\r
+ rrand srand % initializes the random generator\r
+ /getRandReal { rand 2147483647 div } def\r
+ \psk@randomPoints {\r
+ /DS \pst@number\pssizeStar\space getRandReal mul def\r
+ \@nameuse{psds@\psk@dotstyle}\r
+ \ifPst@color getRandReal 1 1 sethsbcolor \fi\r
+ getRandReal dx mul xMin add\r
+ getRandReal dy mul yMin add\r
+ Dot\r
+ \ifx\psk@fillstyle\psfs@solid fill \fi stroke\r
+ } repeat\r
+ }%\r
+ \end@SpecialObj\r
+ \endpsclip\r
+ \ignorespaces\r
+}\r
+\makeatother\r
+%%%%%%%%%%%%%%%%%%\r
+%timeline\r
+\begin{filecontents}{kepler16.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 : une planète à deux soleils comme Tatooine celle de Luke Skywalker dans \textit{La Guerre des étoiles}}\r
+\date{10 juillet 2\,012}\r
+\begin{document}\r
+\maketitle\r
+\section{La représentation avec les données de la NASA}\r
+Ceci est une tentative pour essayer de schématiser une planète orbitant autour d'une étoile binaire, comme Kepler-16b. On parle dans ce cas-là d'une planète \textit{circumbinaire}.\r
+Le site de la NASA dédié à cette planète\footnote{http://kepler.nasa.gov/Mission/discoveries/kepler16b/}, fournit un grand nombre de renseignements sur les étoiles et la planète, ce qui permet de reconstituer leurs trajectoires respectives. Voici les caractéristiques utiles pour le schéma et l'animation.\r
+\begin{center}\r
+\begin{tabular}{|ll|}\r
+\hline\r
+\textbf{ Paramètres}&\textbf{Valeurs}\\ \hline\r
+ \textit{Étoile A}&\\ \hline\r
+ Masse, $M_A(M_{\astrosun})$&0.6897\\\r
+ Rayon, $R_A(R_{\astrosun})$&0.6489\\ \hline\r
+ \textit{Étoile B}&\\ \hline\r
+ Masse, $M_B(M_{\astrosun})$&0.20255\\\r
+ Rayon, $R_B(R_{\astrosun})$&0.22623\\ \hline\r
+ \textit{Planète b}&\\ \hline\r
+ Masse, $M_b(M_{\jupiter})$&0.333\\\r
+ Rayon, $R_b(R_{\jupiter})$&0.7538\\ \hline\r
+ \textit{Orbite de l'étoile binaire}&\\ \hline\r
+ Période(jours)&41.076\\\r
+ Demi-grand axe(ua) $\mathrm{a_1}$&0.22431\\\r
+ Excentricité $\mathrm{e_1}$&0.15944\\\r
+ Argument du périastre(deg) $\omega_1$&263.464\\ \hline\r
+ \textit{Orbite de la planète circumbinaire} &\\ \hline\r
+ Période(jours)&228.776\\\r
+ Demi-grand axe(ua)$\mathrm{a_2}$&0.7048\\\r
+ Excentricité $\mathrm{e_2}$&0.0069\\\r
+ Argument du périastre(deg) $\omega_2$&318\\ \hline\r
+\end{tabular}\r
+\end{center}\r
+\r
+\begin{center}\r
+\begin{pspicture}(-5,-5)(5,5)\r
+\psgrid[subgriddiv=0,gridcolor=lightgray,griddots=10,gridlabels=0pt]%\r
+\pstVerb{% pour le système binaire d'étoiles\r
+ /a1 0.22431 def % semi-major axis\r
+ /e1 0.15944 def % eccentricity\r
+ /w1 263.464 def % argument of periaspe\r
+ /MA 0.6897 def % masse of star A\r
+ /MB 0.20255 def % masse of star B\r
+ /Mt MA MB add def % masse totale\r
+ /P1 41.076 def % period (day)\r
+ % pour la planète\r
+ /Mb 0.3333 def % masse of planet b (M_Jupiter)\r
+ /a2 0.7048 def % semi-major axis\r
+ /e2 0.0069 def % eccentricity\r
+ /w2 318 def % argument of periaspe\r
+ /P2 228.776 def % period (day)\r
+% on en déduit le paramètre de chacune des ellipses\r
+ /p1 a1 1 e1 dup mul add mul def\r
+ /p2 a2 1 e2 dup mul add mul def\r
+ }%\r
+\pnode(!/radius p1 1 e1 w1 w1 sub cos mul add div def\r
+ /radius1 radius MB Mt div mul neg def\r
+ radius1 w1 cos mul 5 mul\r
+ radius1 w1 sin mul 5 mul){MA0}\r
+\parametricplot[plotpoints=360,unit=5,linecolor=red]{0}{360}{\r
+ /radius p1 1 e1 t w1 sub cos mul add div def\r
+ /radius1 radius MB Mt div mul neg def\r
+ radius1 t cos mul\r
+ radius1 t sin mul}\r
+\pscircle[fillstyle=solid,fillcolor=yellow!50](MA0){0.3}\r
+\parametricplot[plotpoints=360,unit=5,linecolor=green]{0}{360}{\r
+ /radius p1 1 e1 t w1 sub cos mul add div def\r
+ /radius2 radius MA Mt div mul def\r
+ radius2 t cos mul\r
+ radius2 t sin mul}\r
+\pnode(!/radius p1 1 e1 w1 w1 sub cos mul add div def\r
+ /radius1 radius MA Mt div mul def\r
+ radius1 w1 cos mul 5 mul\r
+ radius1 w1 sin mul 5 mul){MB0}\r
+\pscircle[fillstyle=solid,fillcolor=red](MB0){0.15}\r
+\parametricplot[plotpoints=360,unit=5,linecolor=blue]{0}{360}{\r
+ /radius p2 1 e2 t w2 sub cos mul add div def\r
+ radius t cos mul\r
+ radius t sin mul}\r
+\pnode(!/radius p2 1 e2 w2 w2 sub cos mul add div def\r
+ radius w2 cos mul 5 mul\r
+ radius w2 sin mul 5 mul){Mb0}\r
+\pscircle[fillstyle=solid,fillcolor=blue](Mb0){0.07}\r
+\end{pspicture}\r
+\end{center}\r
+\section{La simulation avec PSTricks}\r
+\begin{center}\r
+\begin{pspicture}(-3,-1)(6,7)\r
+\psgrid[subgriddiv=0,gridcolor=lightgray,griddots=10,gridlabels=0pt]%\r
+\pstVerb{/x01 -3 def /y01 0 def\r
+ /x02 5 def /y02 0 def\r
+ /xr012 x02 x01 sub def\r
+ /yr012 y02 y01 sub def\r
+ /x0 2 def /y0 5 def\r
+ /xr002 x02 x0 sub def\r
+ /yr002 y02 y0 sub def\r
+ /xr001 x01 x0 sub def\r
+ /yr001 y01 y0 sub def\r
+ /M0 0.2 def\r
+ /M1 0.07 def\r
+ /M2 3.2e-4 def\r
+ /Mt M1 M2 add def\r
+ /xG012 x01 M1 mul x02 M2 mul add Mt div def\r
+ /yG012 y01 M1 mul y02 M2 mul add Mt div def\r
+ }%\r
+\pnode(0,0){O}\r
+\pnode(!x01 y01){M1}\r
+\pnode(!x02 y02){M2}\r
+\pnode(!x0 y0){M0}\r
+\pnode(!xG012 yG012){C12} % centre de masse de M1 et M2\r
+\pscircle[fillstyle=solid,fillcolor=yellow!50](M2){0.21}\r
+\pscircle[fillstyle=solid,fillcolor=red!50](M1){0.5}\r
+\pscircle[fillstyle=solid,fillcolor=blue!50](M0){0.07}\r
+\psline[linestyle=dotted](M1)(M2)\r
+\psline[linestyle=dashed](M2)(M0)(M1)\r
+\psline{<->}(6,0)(0,0)(0,7)\r
+\uput[u](M0){$M_0$}\r
+\uput[r](0,6.8){$y$}\r
+\uput[u](5.8,0){$x$}\r
+\uput[l](0,6.8){$\mathcal{R}$}\r
+\uput{0.6}[d](M1){$M_1$}\r
+\uput{0.25}[d](M2){$M_2$}\r
+\rput(M1){\psline[style=vecteurC]{->}(!xr012 3 div yr012 3 div)\uput[d](!xr012 3 div yr012 3 div){$\overrightarrow{F}_{2/1}$}\r
+ \psline[style=vecteurC]{->}(!xr001 5 div neg yr001 5 div neg)\uput[r](!xr001 5 div neg yr001 5 div neg){$\overrightarrow{F}_{0/1}$}}\r
+\rput(M2){\psline[style=vecteurC]{->}(!xr012 3 div neg yr012 3 div neg)\uput[d](!xr012 3 div neg yr012 3 div neg){$\overrightarrow{F}_{1/2}$}\r
+ \psline[style=vecteurC]{->}(!xr002 3 div neg yr002 3 div neg)\uput[r](!xr002 3 div neg yr002 3 div neg){$\overrightarrow{F}_{0/2}$}}\r
+\rput(M0){\psline[style=vecteurC]{->}(!xr002 3 div yr002 3 div)\uput[r](!xr002 3 div yr002 3 div){$\overrightarrow{F}_{2/0}$}}\r
+\rput(M0){\psline[style=vecteurC]{->}(!xr001 5 div yr001 5 div)\uput[r](!xr001 5 div yr001 5 div){$\overrightarrow{F}_{1/0}$}}\r
+\end{pspicture}\r
+\end{center}\r
+Pour cela, on considère un système de trois corps en interaction gravitationnelle : l'étoile $M_1$ de masse $m_1$, l'étoile $M_2$ de masse $m_2$ constituant l'étoile binaire et une planète $P$ notée $M_0$, de masse $m$ orbitant autour de cette étoile double.\r
+\r
+Avec : $\overrightarrow{r_{01}}=\overrightarrow{M_0M_1}$, $\overrightarrow{r_{02}}=\overrightarrow{M_0M_2}$ et $\overrightarrow{r_{12}}=\overrightarrow{M_1M_2}$ on pose :\r
+\begin{itemize}\r
+ \item $\overrightarrow{r}_{01}=\overrightarrow{r}_1-\overrightarrow{r}_0$\r
+ \item $\overrightarrow{r}_{02}=\overrightarrow{r}_2-\overrightarrow{r}_0$\r
+ \item $\overrightarrow{r}_{12}=\overrightarrow{r}_2-\overrightarrow{r}_1$\r
+\end{itemize}\r
+Chacune des forces s'exprime par :\r
+\[\r
+\left\{\r
+\begin{array}[m]{l}\r
+\overrightarrow{F}_{1/0}=\mathcal{G}\dfrac{m_1m_0}{r_{10}^3}\overrightarrow{r_{01}}=-\overrightarrow{F}_{0/1}\\[1em]\r
+\overrightarrow{F}_{2/0}=\mathcal{G}\dfrac{m_2m_0}{r_{20}^3}\overrightarrow{r_{02}}=-\overrightarrow{F}_{0/2}\\[1em]\r
+\overrightarrow{F}_{2/1}=\mathcal{G}\dfrac{m_1m_2}{r_{12}^3}\overrightarrow{r_{12}}=-\overrightarrow{F}_{1/2}\r
+\end{array}\r
+\right.\r
+\]\r
+L'application de la loi de Newton à chacun des corps donne :\r
+\[\r
+\left\{\r
+\begin{array}[m]{l}\r
+m_0\dfrac{\mathrm{d^2}\overrightarrow{r_0}}{\mathrm{d}t^2}=\hphantom{-}\mathcal{G}\dfrac{m_1m_0}{r_{10}^3}\overrightarrow{r_{01}}+\r
+ \mathcal{G}\dfrac{m_2m_0}{r_{20}^3}\overrightarrow{r_{02}}\\[1em]\r
+m_1\dfrac{\mathrm{d^2}\overrightarrow{r_1}}{\mathrm{d}t^2}=-\mathcal{G}\dfrac{m_0m_1}{r_{10}^3}\overrightarrow{r_{01}}+\r
+ \mathcal{G}\dfrac{m_1m_2}{r_{12}^3}\overrightarrow{r_{12}}\\[1em]\r
+m_2\dfrac{\mathrm{d^2}\overrightarrow{r_2}}{\mathrm{d}t^2}=-\mathcal{G}\dfrac{m_0m_2}{r_{20}^3}\overrightarrow{r_{02}}-\r
+ \mathcal{G}\dfrac{m_1m_2}{r_{12}^3}\overrightarrow{r_{12}}\r
+\end{array}\r
+\right.\r
+\]\r
+Ce qui conduit à un système de 6 équations différentielles :\r
+\[\r
+\left\{\r
+\begin{array}[m]{l}\r
+\ddot{x_0}=\hphantom{-}\mathcal{G}\dfrac{m_1}{r_{10}^3}(x_1-x_0)+\mathcal{G}\dfrac{m_2}{r_{20}^3}(x_2-x_0)\\[1em]\r
+\ddot{y_0}=\hphantom{-}\mathcal{G}\dfrac{m_1}{r_{10}^3}(y_1-y_0)+\mathcal{G}\dfrac{m_2}{r_{20}^3}(y_2-y_0)\\[1em]\r
+\ddot{x_1}=-\mathcal{G}\dfrac{m_0}{r_{10}^3}(x_1-x_0)+\mathcal{G}\dfrac{m_2}{r_{12}^3}(x_2-x_1)\\[1em]\r
+\ddot{y_1}=-\mathcal{G}\dfrac{m_0}{r_{10}^3}(y_1-y_0)+\mathcal{G}\dfrac{m_2}{r_{12}^3}(y_2-y_1)\\[1em]\r
+\ddot{x_2}=-\mathcal{G}\dfrac{m_0}{r_{10}^3}(x_2-x_0)-\mathcal{G}\dfrac{m_1}{r_{12}^3}(x_2-x_1)\\[1em]\r
+\ddot{y_2}=-\mathcal{G}\dfrac{m_0}{r_{02}^3}(y_2-y_0)-\mathcal{G}\dfrac{m_1}{r_{12}^3}(y_2-y_1)\r
+\end{array}\r
+\right.\r
+\]\r
+\r
+\begin{verbatim}\r
+% 0 1 2 3 4 5 6 7 8 9 10 11\r
+% y[0] y[1] y[2] y[3] y[4] y[5] y[6] y[7] y[8] y[9] y[10] y[11]\r
+% x0 y0 x'0 y'0 x1 y1 x'1 y'1 x2 y2 x'2 y'2\r
+\def\GravAlgIIIcorps{%\r
+ y[2]|y[3]|%\r
+ M1*(y[4]-y[0])/((y[4]-y[0])^2+(y[5]-y[1])^2)^1.5+M2*(y[8]-y[0])/((y[8]-y[0])^2+(y[9]-y[1])^2)^1.5|%\r
+ M1*(y[5]-y[1])/((y[4]-y[0])^2+(y[5]-y[1])^2)^1.5+M2*(y[9]-y[1])/((y[8]-y[0])^2+(y[9]-y[1])^2)^1.5|%\r
+ y[6]|y[7]|%\r
+ -M0*(y[4]-y[0])/((y[4]-y[0])^2+(y[5]-y[1])^2)^1.5+M2*(y[8]-y[4])/((y[8]-y[4])^2+(y[9]-y[5])^2)^1.5|%\r
+ -M0*(y[5]-y[1])/((y[4]-y[0])^2+(y[5]-y[1])^2)^1.5+M2*(y[9]-y[5])/((y[8]-y[4])^2+(y[9]-y[5])^2)^1.5|%\r
+ y[10]|y[11]|%\r
+ -M0*(y[8]-y[0])/((y[8]-y[0])^2+(y[9]-y[1])^2)^1.5-M1*(y[8]-y[4])/((y[8]-y[4])^2+(y[9]-y[5])^2)^1.5|%\r
+ -M0*(y[9]-y[1])/((y[8]-y[0])^2+(y[9]-y[1])^2)^1.5-M1*(y[9]-y[5])/((y[8]-y[4])^2+(y[9]-y[5])^2)^1.5}\r
+\end{verbatim}\r
+\r
+\r
+\newpage\r
+% y[0] y[1] y[2] y[3] y[4] y[5] y[6] y[7] y[8] y[9] y[10] y[11]\r
+% x0 y0 x'0 y'0 x1 y1 x'1 y'1 x2 y2 x'2 y'2\r
+\def\GravAlgIIIcorps{%\r
+ y[2]|y[3]|%\r
+ M1*(y[4]-y[0])/((y[4]-y[0])^2+(y[5]-y[1])^2)^1.5+M2*(y[8]-y[0])/((y[8]-y[0])^2+(y[9]-y[1])^2)^1.5|%\r
+ M1*(y[5]-y[1])/((y[4]-y[0])^2+(y[5]-y[1])^2)^1.5+M2*(y[9]-y[1])/((y[8]-y[0])^2+(y[9]-y[1])^2)^1.5|%\r
+ y[6]|y[7]|%\r
+ -M0*(y[4]-y[0])/((y[4]-y[0])^2+(y[5]-y[1])^2)^1.5+M2*(y[8]-y[4])/((y[8]-y[4])^2+(y[9]-y[5])^2)^1.5|%\r
+ -M0*(y[5]-y[1])/((y[4]-y[0])^2+(y[5]-y[1])^2)^1.5+M2*(y[9]-y[5])/((y[8]-y[4])^2+(y[9]-y[5])^2)^1.5|%\r
+ y[10]|y[11]|%\r
+ -M0*(y[8]-y[0])/((y[8]-y[0])^2+(y[9]-y[1])^2)^1.5-M1*(y[8]-y[4])/((y[8]-y[4])^2+(y[9]-y[5])^2)^1.5|%\r
+ -M0*(y[9]-y[1])/((y[8]-y[0])^2+(y[9]-y[1])^2)^1.5-M1*(y[9]-y[5])/((y[8]-y[4])^2+(y[9]-y[5])^2)^1.5}\r
+%\r
+\r
+\begin{center}\r
+\def\InitCond{x00 y00 v0x0 v0y0 x01 y01 v0x1 v0y1 x02 y02 v0x2 v0y2}\r
+\psset{method=rk4}\r
+\begin{pspicture}(-8,-8)(8,8)\r
+\psframe*[linecolor={[cmyk]{1 1 0 0.7}}](-8,-8)(8,8)\r
+\pstVerb{\r
+/arccos {\r
+ dup\r
+ dup mul neg 1 add sqrt\r
+ exch\r
+ atan\r
+} def\r
+ /G 1 def\r
+ /w2 55 def\r
+ /x00 7 w2 cos mul def /y00 7 w2 sin mul def\r
+ /x01 0.4962 def\r
+ /y01 0 def\r
+ /v0x1 0 def\r
+ /v0y1 .135 def\r
+ /x02 -1.69 def\r
+ /y02 0 def\r
+ /v0x2 0 def\r
+ /v0y2 -.46 def\r
+ /v0x0 0.36 w2 sin mul neg def\r
+ /v0y0 0.36 w2 cos mul def\r
+ /M1 0.7 def\r
+ /M2 0.2 def\r
+ /M0 3e-4 def\r
+ /Mt M1 M2 add def\r
+ /xG012 x01 M1 mul x02 M2 mul add Mt div def\r
+ /yG012 y01 M1 mul y02 M2 mul add Mt div def\r
+ }%\r
+\psgrid[subgriddiv=0,gridcolor=white,griddots=10,gridlabels=0pt](-8,-8)(8,8)%\r
+\psequadiff[plotpoints=1000,algebraic,\r
+ plotfuncx=y 4 get\r
+ y 4 get M1 mul\r
+ y 8 get M2 mul add\r
+ M1 M2 add div\r
+ sub,\r
+ plotfuncy=5 get\r
+ dup M1 mul\r
+ y 9 get M2 mul add\r
+ M1 M2 add div\r
+ sub,\r
+ tabname=XAYA,\r
+ saveData,filename=XAYA.dat\r
+% ]{0}{18}{\InitCond}{\GravAlgIIIcorps}\r
+ ]{0}{120}{\InitCond}{\GravAlgIIIcorps}\r
+\listplot[unit=1,linecolor=yellow]{XAYA aload pop}\r
+\psequadiff[plotpoints=1000,algebraic,\r
+ plotfuncx=y 8 get\r
+ y 4 get M1 mul\r
+ y 8 get M2 mul add\r
+ M1 M2 add div\r
+ sub,\r
+ plotfuncy=9 get\r
+ dup M2 mul\r
+ y 5 get M1 mul add\r
+ M1 M2 add div\r
+ sub,\r
+ tabname=XBYB,\r
+ saveData,filename=XBYB.dat\r
+% ]{0}{18}{\InitCond}{\GravAlgIIIcorps}\r
+ ]{0}{120}{\InitCond}{\GravAlgIIIcorps}\r
+\listplot[unit=1,linecolor=red]{XBYB aload pop}\r
+\psequadiff[plotpoints=1000,algebraic,\r
+ plotfuncx=y 0 get\r
+ y 4 get M1 mul\r
+ y 8 get M2 mul add\r
+ M1 M2 add div\r
+ sub,\r
+ plotfuncy=1 get\r
+ y 5 get M1 mul\r
+ y 9 get M2 mul add\r
+ M1 M2 add div\r
+ sub,\r
+ tabname=XbYb,\r
+ saveData,filename=XPYP.dat\r
+ ]{0}{120}{\InitCond}{\GravAlgIIIcorps}\r
+\listplot[unit=1,linecolor=blue]{XbYb aload pop}\r
+\pnode(!x01 xG012 sub y01 yG012 sub){M01}\r
+\pnode(!x02 xG012 sub y02 yG012 sub){M02}\r
+\pnode(!x00 xG012 sub y00 yG012 sub){M00}\r
+\pscircle*[linecolor=yellow](M01){0.4}\r
+\pscircle*[linecolor=red](M02){0.16}\r
+\pscircle*[linecolor=white](M00){0.07}\r
+%\rput(M01){\psline[unit=2,linecolor=red]{->}(!v0x1 v0y1)}\r
+%\rput(M02){\psline[unit=2,linecolor=blue]{->}(!v0x2 v0y2)}\r
+\psdot(!xG012 yG012)\r
+\end{pspicture}\r
+\end{center}\r
+\section{Animation avec pst-eqdf et animate}\r
+\begin{center}\r
+\def\nFrames{200}% 200 images\r
+\begin{animateinline}[controls,timeline=kepler16.dat,loop,%\r
+ begin={\begin{pspicture}(-8,-8)(8,8)},\r
+ end={\end{pspicture}}]{5}% 5 images/s\r
+\pstVerb{/XY1 [(XAYA.dat) run] def\r
+ /XY2 [(XBYB.dat) run] def\r
+ /XY3 [(XPYP.dat) run] def\r
+ }%\r
+\psframe*[linecolor={[cmyk]{1 1 0 0.7}}](-8,-8)(8,8)\r
+\psRandomStar[linecolor={[rgb]{1,1,0.5}},\r
+ randomPoints=1000,sizeStar=1pt](-8,-8)(8,8){\psframe[linestyle=none](-8,-8)(8,8)}\r
+%\listplot[linecolor=gray]{XY1 aload pop}\r
+%\listplot[linecolor=gray]{XY2 aload pop}\r
+%\listplot[linecolor=gray]{XY3 aload pop}\r
+\newframe\r
+\multiframe{\nFrames}{i=0+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
+ /X3 XY3 \i\space get def\r
+ /Y3 XY3 \i\space 1 add get def\r
+ }%\r
+%\psdot(!X1 Y1)\r
+\pscircle*[linecolor=yellow](!X1 Y1){0.5}\r
+\pscircle*[linecolor=red](!X2 Y2){0.2}\r
+\pscircle*[linecolor=white](!X3 Y3){0.07}\r
+}\r
+\end{animateinline}\r
+\end{center}\r
+\end{document}\r
+\r
--- /dev/null
+\r
+\documentclass{article}\r
+\usepackage[a4paper,margin=2cm]{geometry}\r
+\usepackage[T1]{fontenc}\r
+\usepackage[latin1]{inputenc}%\r
+\usepackage[garamond]{mathdesign}\r
+\usepackage{pstricks,pst-eqdf,pst-node}\r
+\usepackage{animate}\r
+\newpsstyle{vecteurA}{arrowinset=0.05,arrowsize=0.1,linecolor={[rgb]{1 0.5 0}}}\r
+\newpsstyle{vecteurB}{arrowinset=0.05,arrowsize=0.1,linecolor={[rgb]{0 0.5 1}}}\r
+\newpsstyle{vecteurC}{arrowinset=0.1,arrowsize=0.2,linecolor={[rgb]{1 0 0}}}\r
+%timeline\r
+\begin{filecontents}{kepler16.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
+\makeatletter\r
+%% adapté de \psRandom du package pstricks-add\r
+%% pour rendre aléatoire la taille des étoiles\r
+%% Manuel Luque\r
+\newdimen\pssizeStar\r
+\def\psset@sizeStar#1{\pssetlength\pssizeStar{#1}}\r
+\psset@sizeStar{1pt}\r
+\define@key[psset]{pst-eqd}{randomPoints}[1000]{\def\psk@randomPoints{#1}}\r
+\psset[pst-eqd]{randomPoints=1000}\r
+\define@boolkey[psset]{pst-eqd}[Pst@]{color}[true]{}\r
+\psset[pst-eqd]{color=false}\r
+\def\psRandomStar{\pst@object{psRandomStar}}%\r
+\def\psRandomStar@i{\@ifnextchar({\psRandomStar@ii}{\psRandomStar@iii(0,0)(1,1)}}\r
+\def\psRandomStar@ii(#1){\@ifnextchar({\psRandomStar@iii(#1)}{\psRandomStar@iii(0,0)(#1)}}\r
+\def\psRandomStar@iii(#1)(#2)#3{%\r
+ \def\pst@tempA{#3}%\r
+ \ifx\pst@tempA\pst@empty\psclip{\psframe(#2)}\else\psclip{#3}\fi\r
+ \pst@getcoor{#1}\pst@tempA\r
+ \pst@getcoor{#2}\pst@tempB\r
+ \begin@SpecialObj\r
+ \addto@pscode{\r
+ \pst@tempA\space /yMin exch def\r
+ /xMin exch def\r
+ \pst@tempB\space /yMax exch def\r
+ /xMax exch def\r
+ /dy yMax yMin sub def\r
+ /dx xMax xMin sub def\r
+ rrand srand % initializes the random generator\r
+ /getRandReal { rand 2147483647 div } def\r
+ \psk@randomPoints {\r
+ /DS \pst@number\pssizeStar\space getRandReal mul def\r
+ \@nameuse{psds@\psk@dotstyle}\r
+ \ifPst@color getRandReal 1 1 sethsbcolor \fi\r
+ getRandReal dx mul xMin add\r
+ getRandReal dy mul yMin add\r
+ Dot\r
+ \ifx\psk@fillstyle\psfs@solid fill \fi stroke\r
+ } repeat\r
+ }%\r
+ \end@SpecialObj\r
+ \endpsclip\r
+ \ignorespaces\r
+}\r
+\makeatother\r
+%%%%%%%%%%%%%%%%%%%%%%%\r
+\title{Gravitation : une planète à deux soleils comme Tatooine celle de Luke Skywalker dans La Guerre des étoiles}\r
+\date{10 juillet 2\,012}\r
+\begin{document}\r
+\begin{center}\r
+\pstVerb{/XY1 [(XAYA.dat) run] def\r
+ /XY2 [(XBYB.dat) run] def\r
+ /XY3 [(XPYP.dat) run] def\r
+ }%\r
+\def\nFrames{200}% 200 images\r
+\begin{animateinline}[controls,timeline=kepler16.dat,loop,%\r
+ begin={\begin{pspicture}(-8,-8)(8,8)},\r
+ end={\end{pspicture}}]{5}% 5 images/s\r
+\psframe*[linecolor={[cmyk]{1 1 0 0.7}}](-8,-8)(8,8)\r
+\psRandomStar[linecolor={[rgb]{1,1,0.5}},\r
+ randomPoints=1000,sizeStar=1pt](-8,-8)(8,8){\psframe[linestyle=none](-8,-8)(8,8)}\r
+%\listplot[linecolor=gray]{XY1 aload pop}\r
+%\listplot[linecolor=gray]{XY2 aload pop}\r
+%\listplot[linecolor=gray]{XY3 aload pop}\r
+\newframe\r
+\multiframe{\nFrames}{i=0+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
+ /X3 XY3 \i\space get def\r
+ /Y3 XY3 \i\space 1 add get def\r
+ }%\r
+%\psdot(!X1 Y1)\r
+\pscircle*[linecolor=yellow](!X1 Y1){0.5}\r
+\pscircle*[linecolor=red](!X2 Y2){0.2}\r
+\pscircle*[linecolor=white](!X3 Y3){0.07}\r
+}\r
+\end{animateinline}\r
+\end{center}\r
+\end{document}\r
+\r