Cette partie donne des explications sur la représentation des orbites à partir des...
[pst-eqdf.git] / gravitation / animation_kepler16_pstricks.tex
1
2 \documentclass{article}
3 \usepackage[a4paper,margin=2cm]{geometry}
4 \usepackage[T1]{fontenc}
5 \usepackage[latin1]{inputenc}%
6 \usepackage[garamond]{mathdesign}
7 \usepackage{pstricks,pst-eqdf,pst-node}
8 \usepackage{animate}
9 \newpsstyle{vecteurA}{arrowinset=0.05,arrowsize=0.1,linecolor={[rgb]{1 0.5 0}}}
10 \newpsstyle{vecteurB}{arrowinset=0.05,arrowsize=0.1,linecolor={[rgb]{0 0.5 1}}}
11 \newpsstyle{vecteurC}{arrowinset=0.1,arrowsize=0.2,linecolor={[rgb]{1 0 0}}}
12 %timeline
13 \begin{filecontents}{kepler16.dat}
14 ::0x0
15 ::1
16 ::2
17 ::3
18 ::4
19 ::5
20 ::6
21 ::7
22 ::8
23 ::9
24 ::10
25 ::11
26 ::12
27 ::13
28 ::14
29 ::15
30 ::16
31 ::17
32 ::18
33 ::19
34 ::20
35 ::21
36 ::22
37 ::23
38 ::24
39 ::25
40 ::26
41 ::27
42 ::28
43 ::29
44 ::30
45 ::31
46 ::32
47 ::33
48 ::34
49 ::35
50 ::36
51 ::37
52 ::38
53 ::39
54 ::40
55 ::41
56 ::42
57 ::43
58 ::44
59 ::45
60 ::46
61 ::47
62 ::48
63 ::49
64 ::50
65 ::51
66 ::52
67 ::53
68 ::54
69 ::55
70 ::56
71 ::57
72 ::58
73 ::59
74 ::60
75 ::61
76 ::62
77 ::63
78 ::64
79 ::65
80 ::66
81 ::67
82 ::68
83 ::69
84 ::70
85 ::71
86 ::72
87 ::73
88 ::74
89 ::75
90 ::76
91 ::77
92 ::78
93 ::79
94 ::80
95 ::81
96 ::82
97 ::83
98 ::84
99 ::85
100 ::86
101 ::87
102 ::88
103 ::89
104 ::90
105 ::91
106 ::92
107 ::93
108 ::94
109 ::95
110 ::96
111 ::97
112 ::98
113 ::99
114 ::100
115 ::101
116 ::102
117 ::103
118 ::104
119 ::105
120 ::106
121 ::107
122 ::108
123 ::109
124 ::110
125 ::111
126 ::112
127 ::113
128 ::114
129 ::115
130 ::116
131 ::117
132 ::118
133 ::119
134 ::120
135 ::121
136 ::122
137 ::123
138 ::124
139 ::125
140 ::126
141 ::127
142 ::128
143 ::129
144 ::130
145 ::131
146 ::132
147 ::133
148 ::134
149 ::135
150 ::136
151 ::137
152 ::138
153 ::139
154 ::140
155 ::141
156 ::142
157 ::143
158 ::144
159 ::145
160 ::146
161 ::147
162 ::148
163 ::149
164 ::150
165 ::151
166 ::152
167 ::153
168 ::154
169 ::155
170 ::156
171 ::157
172 ::158
173 ::159
174 ::160
175 ::161
176 ::162
177 ::163
178 ::164
179 ::165
180 ::166
181 ::167
182 ::168
183 ::169
184 ::170
185 ::171
186 ::172
187 ::173
188 ::174
189 ::175
190 ::176
191 ::177
192 ::178
193 ::179
194 ::180
195 ::181
196 ::182
197 ::183
198 ::184
199 ::185
200 ::186
201 ::187
202 ::188
203 ::189
204 ::190
205 ::191
206 ::192
207 ::193
208 ::194
209 ::195
210 ::196
211 ::197
212 ::198
213 ::199
214 ::200
215 \end{filecontents}
216 %%%%%%%%%%%%%%%%%%
217 \makeatletter
218 %% adapté de \psRandom du package pstricks-add
219 %% pour rendre aléatoire la taille des étoiles
220 %% Manuel Luque
221 \newdimen\pssizeStar
222 \def\psset@sizeStar#1{\pssetlength\pssizeStar{#1}}
223 \psset@sizeStar{1pt}
224 \define@key[psset]{pst-eqd}{randomPoints}[1000]{\def\psk@randomPoints{#1}}
225 \psset[pst-eqd]{randomPoints=1000}
226 \define@boolkey[psset]{pst-eqd}[Pst@]{color}[true]{}
227 \psset[pst-eqd]{color=false}
228 \def\psRandomStar{\pst@object{psRandomStar}}%
229 \def\psRandomStar@i{\@ifnextchar({\psRandomStar@ii}{\psRandomStar@iii(0,0)(1,1)}}
230 \def\psRandomStar@ii(#1){\@ifnextchar({\psRandomStar@iii(#1)}{\psRandomStar@iii(0,0)(#1)}}
231 \def\psRandomStar@iii(#1)(#2)#3{%
232 \def\pst@tempA{#3}%
233 \ifx\pst@tempA\pst@empty\psclip{\psframe(#2)}\else\psclip{#3}\fi
234 \pst@getcoor{#1}\pst@tempA
235 \pst@getcoor{#2}\pst@tempB
236 \begin@SpecialObj
237 \addto@pscode{
238 \pst@tempA\space /yMin exch def
239 /xMin exch def
240 \pst@tempB\space /yMax exch def
241 /xMax exch def
242 /dy yMax yMin sub def
243 /dx xMax xMin sub def
244 rrand srand % initializes the random generator
245 /getRandReal { rand 2147483647 div } def
246 \psk@randomPoints {
247 /DS \pst@number\pssizeStar\space getRandReal mul def
248 \@nameuse{psds@\psk@dotstyle}
249 \ifPst@color getRandReal 1 1 sethsbcolor \fi
250 getRandReal dx mul xMin add
251 getRandReal dy mul yMin add
252 Dot
253 \ifx\psk@fillstyle\psfs@solid fill \fi stroke
254 } repeat
255 }%
256 \end@SpecialObj
257 \endpsclip
258 \ignorespaces
259 }
260 \makeatother
261 %%%%%%%%%%%%%%%%%%%%%%%
262 \title{Gravitation : une planète à deux soleils comme Tatooine celle de Luke Skywalker dans La Guerre des étoiles}
263 \date{10 juillet 2\,012}
264 \begin{document}
265 \begin{center}
266 \pstVerb{/XY1 [(XAYA.dat) run] def
267 /XY2 [(XBYB.dat) run] def
268 /XY3 [(XPYP.dat) run] def
269 }%
270 \def\nFrames{200}% 200 images
271 \begin{animateinline}[controls,timeline=kepler16.dat,loop,%
272 begin={\begin{pspicture}(-8,-8)(8,8)},
273 end={\end{pspicture}}]{5}% 5 images/s
274 \psframe*[linecolor={[cmyk]{1 1 0 0.7}}](-8,-8)(8,8)
275 \psRandomStar[linecolor={[rgb]{1,1,0.5}},
276 randomPoints=1000,sizeStar=1pt](-8,-8)(8,8){\psframe[linestyle=none](-8,-8)(8,8)}
277 %\listplot[linecolor=gray]{XY1 aload pop}
278 %\listplot[linecolor=gray]{XY2 aload pop}
279 %\listplot[linecolor=gray]{XY3 aload pop}
280 \newframe
281 \multiframe{\nFrames}{i=0+10}{% 1 point sur 10
282 \pstVerb{/X1 XY1 \i\space get def
283 /Y1 XY1 \i\space 1 add get def
284 /X2 XY2 \i\space get def
285 /Y2 XY2 \i\space 1 add get def
286 /X3 XY3 \i\space get def
287 /Y3 XY3 \i\space 1 add get def
288 }%
289 %\psdot(!X1 Y1)
290 \pscircle*[linecolor=yellow](!X1 Y1){0.5}
291 \pscircle*[linecolor=red](!X2 Y2){0.2}
292 \pscircle*[linecolor=white](!X3 Y3){0.07}
293 }
294 \end{animateinline}
295 \end{center}
296 \end{document}
297

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.