Cette partie donne des explications sur la représentation des orbites à partir des...
[pst-eqdf.git] / gravitation / Kepler16_animation_Nasa.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{pst-eqdf,pst-node}
8 %\usepackage{array,amsmath}
9 \usepackage{animate}
10 \usepackage{pst-grad}
11 %\usepackage{wasysym}
12 %\usepackage{url}
13 \newpsstyle{vecteurA}{arrowinset=0.05,arrowsize=0.1,linecolor={[rgb]{1 0.5 0}}}
14 \newpsstyle{vecteurB}{arrowinset=0.05,arrowsize=0.1,linecolor={[rgb]{0 0.5 1}}}
15 \newpsstyle{vecteurC}{arrowinset=0.1,arrowsize=0.2,linecolor={[rgb]{1 0 0}}}
16 \makeatletter
17 %% adapté de \psRandom du package pstricks-add
18 %% pour rendre aléatoire la taille des étoiles
19 %% Manuel Luque
20 \newdimen\pssizeStar
21 \def\psset@sizeStar#1{\pssetlength\pssizeStar{#1}}
22 \psset@sizeStar{1pt}
23 \define@key[psset]{pst-eqd}{randomPoints}[1000]{\def\psk@randomPoints{#1}}
24 \psset[pst-eqd]{randomPoints=1000}
25 \define@boolkey[psset]{pst-eqd}[Pst@]{color}[true]{}
26 \psset[pst-eqd]{color=false}
27 \def\psRandomStar{\pst@object{psRandomStar}}%
28 \def\psRandomStar@i{\@ifnextchar({\psRandomStar@ii}{\psRandomStar@iii(0,0)(1,1)}}
29 \def\psRandomStar@ii(#1){\@ifnextchar({\psRandomStar@iii(#1)}{\psRandomStar@iii(0,0)(#1)}}
30 \def\psRandomStar@iii(#1)(#2)#3{%
31 \def\pst@tempA{#3}%
32 \ifx\pst@tempA\pst@empty\psclip{\psframe(#2)}\else\psclip{#3}\fi
33 \pst@getcoor{#1}\pst@tempA
34 \pst@getcoor{#2}\pst@tempB
35 \begin@SpecialObj
36 \addto@pscode{
37 \pst@tempA\space /yMin exch def
38 /xMin exch def
39 \pst@tempB\space /yMax exch def
40 /xMax exch def
41 /dy yMax yMin sub def
42 /dx xMax xMin sub def
43 rrand srand % initializes the random generator
44 /getRandReal { rand 2147483647 div } def
45 \psk@randomPoints {
46 /DS \pst@number\pssizeStar\space getRandReal mul def
47 \@nameuse{psds@\psk@dotstyle}
48 \ifPst@color getRandReal 1 1 sethsbcolor \fi
49 getRandReal dx mul xMin add
50 getRandReal dy mul yMin add
51 Dot
52 \ifx\psk@fillstyle\psfs@solid fill \fi stroke
53 } repeat
54 }%
55 \end@SpecialObj
56 \endpsclip
57 \ignorespaces
58 }
59 \makeatother
60 %%%%%%%%%%%%%%%%%%
61 %timeline
62 \begin{filecontents}{kepler16Nasa.dat}
63 ::0x0
64 ::1
65 ::2
66 ::3
67 ::4
68 ::5
69 ::6
70 ::7
71 ::8
72 ::9
73 ::10
74 ::11
75 ::12
76 ::13
77 ::14
78 ::15
79 ::16
80 ::17
81 ::18
82 ::19
83 ::20
84 ::21
85 ::22
86 ::23
87 ::24
88 ::25
89 ::26
90 ::27
91 ::28
92 ::29
93 ::30
94 ::31
95 ::32
96 ::33
97 ::34
98 ::35
99 ::36
100 ::37
101 ::38
102 ::39
103 ::40
104 ::41
105 ::42
106 ::43
107 ::44
108 ::45
109 ::46
110 ::47
111 ::48
112 ::49
113 ::50
114 ::51
115 ::52
116 ::53
117 ::54
118 ::55
119 ::56
120 ::57
121 ::58
122 ::59
123 ::60
124 ::61
125 ::62
126 ::63
127 ::64
128 ::65
129 ::66
130 ::67
131 ::68
132 ::69
133 ::70
134 ::71
135 ::72
136 ::73
137 ::74
138 ::75
139 ::76
140 ::77
141 ::78
142 ::79
143 ::80
144 ::81
145 ::82
146 ::83
147 ::84
148 ::85
149 ::86
150 ::87
151 ::88
152 ::89
153 ::90
154 ::91
155 ::92
156 ::93
157 ::94
158 ::95
159 ::96
160 ::97
161 ::98
162 ::99
163 ::100
164 ::101
165 ::102
166 ::103
167 ::104
168 ::105
169 ::106
170 ::107
171 ::108
172 ::109
173 ::110
174 ::111
175 ::112
176 ::113
177 ::114
178 ::115
179 ::116
180 ::117
181 ::118
182 ::119
183 ::120
184 ::121
185 ::122
186 ::123
187 ::124
188 ::125
189 ::126
190 ::127
191 ::128
192 ::129
193 ::130
194 ::131
195 ::132
196 ::133
197 ::134
198 ::135
199 ::136
200 ::137
201 ::138
202 ::139
203 ::140
204 ::141
205 ::142
206 ::143
207 ::144
208 ::145
209 ::146
210 ::147
211 ::148
212 ::149
213 ::150
214 ::151
215 ::152
216 ::153
217 ::154
218 ::155
219 ::156
220 ::157
221 ::158
222 ::159
223 ::160
224 ::161
225 ::162
226 ::163
227 ::164
228 ::165
229 ::166
230 ::167
231 ::168
232 ::169
233 ::170
234 ::171
235 ::172
236 ::173
237 ::174
238 ::175
239 ::176
240 ::177
241 ::178
242 ::179
243 ::180
244 ::181
245 ::182
246 ::183
247 ::184
248 ::185
249 ::186
250 ::187
251 ::188
252 ::189
253 ::190
254 ::191
255 ::192
256 ::193
257 ::194
258 ::195
259 ::196
260 ::197
261 ::198
262 ::199
263 ::200
264 ::201
265 ::202
266 ::203
267 ::204
268 ::205
269 ::206
270 ::207
271 ::208
272 ::209
273 ::210
274 ::211
275 ::212
276 ::213
277 ::214
278 ::215
279 ::216
280 ::217
281 ::218
282 ::219
283 ::220
284 ::221
285 ::222
286 ::223
287 ::224
288 ::225
289 ::226
290 ::227
291 ::228
292 ::229
293 ::230
294 ::231
295 \end{filecontents}
296 \title{Gravitation : une planète à deux soleils - animation \textsc{Nasa}}
297 \date{17 juillet 2\,012}
298 \begin{document}
299 %\section{L'animation à partir des données de la \textsc{Nasa}}
300 \maketitle
301 \begin{center}
302 \def\nFrames{230}% 230 images (229 jours)
303 \begin{animateinline}[controls,timeline=kepler16Nasa.dat,loop,%
304 begin={\begin{pspicture}(-8,-8)(8,8)},
305 end={\end{pspicture}}]{10}% 10 images/s
306 \pstVerb{%
307 /Pi 3.14159265359 def
308 /2Pi 6.28318530718 def
309 % les angles doivent être en degrés
310 % pour calculer les sinus, cosinus
311 % en postscript
312 /rad2deg { 180 mul Pi div } bind def % radians -> degrés
313 /deg2rad { 180 div Pi mul } bind def % degrés -> radians
314 /tan {dup sin exch cos div} def
315 /arctan {
316 dup 0 ge
317 {1 atan}
318 {neg 1 atan neg}
319 ifelse
320 } def
321 /AV { % anomalie vraie
322 1 exc add 1 exc sub div sqrt AE rad2deg 2 div tan mul arctan 2 mul
323 } def
324 /mA 0.6897 def % masse étoile A
325 /mB 0.20255 def% masse étoile B
326 /mt mA mB add def % masse totale
327 /mP 3e-4 def % masse planète
328 /a1 0.22431 def % a pour le point réduit
329 /e1 0.15944 def % excentricité
330 /p1 a1 1 e1 dup mul sub mul def % paramètre
331 /pA p1 mB mul mt div def % paramètre star A
332 /pB p1 mA mul mt div def % paramètre star B
333 /e2 0.0069 def % excentricité planète
334 /a2 0.7048 def % demi-grand axe planète
335 /w1 263.464 def % arguument
336 /w2 318 def % arguument planète
337 /p2 a2 1 e2 dup mul sub mul def % paramètre planète
338 % t T e Kepler -> AE
339 % date periode excentricité -> Kepler -> anomalie excentrique
340 /Kepler {
341 /exc exch def
342 /Ti exch def
343 /ti exch def
344 /AM ti 2Pi mul Ti div def % anomalie moyenne à la date t
345 /AE AM def % valeur initiale de anomalie excentrique
346 5 {% 5 boucles
347 /AETemp % anomalie excentrique provisoire
348 AM exc rad2deg AE sin mul add
349 def
350 /AE AETemp def
351 } repeat
352 }def
353 % étoiles A et B
354 % T=41.076 jours e=0.15944
355 % planète
356 % T=228.776 j e=0.0069
357 % on calcule sur la periode la planète
358 % on construit les tableaux des positions
359 % à 1 jour d'intervalle
360 /tabStarA [
361 0 1 229 {/i exch def
362 i 41.076 e1 Kepler
363 /radius pA 1 e1 AV cos mul add div neg def
364 radius AV w1 add cos mul
365 radius AV w1 add sin mul
366 } for
367 ] def
368 /tabStarB [
369 0 1 229 {/i exch def
370 i 41.076 e1 Kepler
371 /radius pB 1 e1 AV cos mul add div def
372 radius AV w1 add cos mul
373 radius AV w1 add sin mul
374 } for
375 ] def
376 /tabPlanet [
377 0 1 229 {/i exch def
378 i 228.776 e2 Kepler
379 /radius p2 1 e2 AV cos mul add div def
380 radius AV w2 add cos mul
381 radius AV w2 add sin mul
382 } for
383 ] def
384 }%
385 \psframe*[linecolor={[cmyk]{1 1 0 0.7}}](-8,-8)(8,8)
386 \psRandomStar[linecolor={[rgb]{1,1,0.5}},
387 randomPoints=1000,sizeStar=1pt](-8,-8)(8,8){\psframe[linestyle=none](-8,-8)(8,8)}
388 %\listplot[unit=10,linecolor=gray]{tabStarA aload pop}
389 %\listplot[unit=10,linecolor=gray]{tabStarB aload pop}
390 %\listplot[unit=10,linecolor=gray]{tabPlanet aload pop}
391 \newframe
392 \multiframe{\nFrames}{i=0+2}{%
393 \pstVerb{/i1 \i\space def
394 /xA tabStarA i1 get 10 mul def
395 /yA tabStarA i1 1 add get 10 mul def
396 /xB tabStarB i1 get 10 mul def
397 /yB tabStarB i1 1 add get 10 mul def
398 /xP tabPlanet i1 get 10 mul def
399 /yP tabPlanet i1 1 add get 10 mul def
400 }%
401 \pscircle[linestyle=none,fillstyle=gradient,gradmidpoint=0,gradend=yellow,GradientCircle=true,gradbegin=yellow!50!red!50](!xA yA){0.6}
402 \pscircle[linestyle=none,fillstyle=gradient,gradmidpoint=0,gradend=red,GradientCircle=true,gradbegin=red!50](!xB yB){0.2}
403 \pscircle*[linecolor=white](!xP yP){0.1}
404 }
405 \end{animateinline}
406 \end{center}
407 \end{document}
408

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.