2 \documentclass{article
}
3 \usepackage[a4paper,margin=
2cm
]{geometry
}
4 \usepackage{pst-eqdf,pst-node,pst-tools
}
8 \begin{filecontents
}{pb2corps.dat
}
212 \title{Gravitation : le problème des deux corps avec PSTricks\\ partie
2}
213 \date{5 juillet
2\,
012}
216 \pstVerb{/XY1
[(XYM1.dat) run
] def
217 /XY2
[(XYM2.dat) run
] def
218 /XYG
[(XYG.dat) run
] def
}%
219 \def\nFrames{200}% 200 images
220 \begin{animateinline
}[controls,loop,timeline=pb2corps.dat,
%
221 begin=
{\begin{pspicture
}(-
4,-
5)(
13,
12)
},
222 end=
{\end{pspicture
}}]{10}% 10 images/s
223 \psframe*(-
4,-
5)(
13,
12)
224 \psgrid[subgriddiv=
0,gridcolor=white,griddots=
10,gridlabels=
0pt
]%
225 \listplot[linecolor=gray
]{XY1 aload pop
}
226 \listplot[linecolor=gray
]{XY2 aload pop
}
227 \listplot[linecolor=gray
]{XYG aload pop
}
229 \multiframe{\nFrames}{i=
0+
10,I=
2+
10}{% 1 point sur 10
230 \pstVerb{/X1 XY1
\i\space get def
231 /Y1 XY1
\i\space 1 add get def
232 /X2 XY2
\i\space get def
233 /Y2 XY2
\i\space 1 add get def
234 /XG XYG
\i\space get def
235 /YG XYG
\i\space 1 add get def
237 0 2 \I\space {/i exch def
243 0 2 \I\space {/i exch def
249 0 2 \I\space {/i exch def
255 \psgrid[subgriddiv=
0,gridcolor=white,griddots=
10,gridlabels=
0pt
]%
256 \listplot[linecolor=red
]{xy1 aload pop
}
257 \listplot[linecolor=blue!
50]{xy2 aload pop
}
258 \listplot[linecolor=yellow
]{xyG aload pop
}
259 \pscircle*
[linecolor=red
](!X1 Y1)
{0.3}
260 \pscircle*
[linecolor=blue!
50](!X2 Y2)
{0.1}
261 \pscircle*
[linecolor=yellow
](!XG YG)
{0.05}
262 %\psline[linestyle=dashed,linecolor=white](!X1 Y1)(!X2 Y2)