X-Git-Url: https://melusine.eu.org/syracuse/G/git/?p=pst-eqdf.git;a=blobdiff_plain;f=gravitation%2FKepler16_animation_Nasa.tex;fp=gravitation%2FKepler16_animation_Nasa.tex;h=7e3e66a0336ff32dce2b2b16656d97c3a3bc7b6f;hp=0000000000000000000000000000000000000000;hb=0b29bfefc005b11ee2e902e257f615db937f7faa;hpb=e40d7126380dcaee5fd5a773d5ca6c5b6736ccb2 diff --git a/gravitation/Kepler16_animation_Nasa.tex b/gravitation/Kepler16_animation_Nasa.tex new file mode 100644 index 0000000..7e3e66a --- /dev/null +++ b/gravitation/Kepler16_animation_Nasa.tex @@ -0,0 +1,408 @@ + +\documentclass{article} +\usepackage[a4paper,margin=2cm]{geometry} +\usepackage[T1]{fontenc} +\usepackage[latin1]{inputenc}% +\usepackage[garamond]{mathdesign} +\usepackage{pst-eqdf,pst-node} +%\usepackage{array,amsmath} +\usepackage{animate} +\usepackage{pst-grad} +%\usepackage{wasysym} +%\usepackage{url} +\newpsstyle{vecteurA}{arrowinset=0.05,arrowsize=0.1,linecolor={[rgb]{1 0.5 0}}} +\newpsstyle{vecteurB}{arrowinset=0.05,arrowsize=0.1,linecolor={[rgb]{0 0.5 1}}} +\newpsstyle{vecteurC}{arrowinset=0.1,arrowsize=0.2,linecolor={[rgb]{1 0 0}}} +\makeatletter +%% adapté de \psRandom du package pstricks-add +%% pour rendre aléatoire la taille des étoiles +%% Manuel Luque +\newdimen\pssizeStar +\def\psset@sizeStar#1{\pssetlength\pssizeStar{#1}} +\psset@sizeStar{1pt} +\define@key[psset]{pst-eqd}{randomPoints}[1000]{\def\psk@randomPoints{#1}} +\psset[pst-eqd]{randomPoints=1000} +\define@boolkey[psset]{pst-eqd}[Pst@]{color}[true]{} +\psset[pst-eqd]{color=false} +\def\psRandomStar{\pst@object{psRandomStar}}% +\def\psRandomStar@i{\@ifnextchar({\psRandomStar@ii}{\psRandomStar@iii(0,0)(1,1)}} +\def\psRandomStar@ii(#1){\@ifnextchar({\psRandomStar@iii(#1)}{\psRandomStar@iii(0,0)(#1)}} +\def\psRandomStar@iii(#1)(#2)#3{% + \def\pst@tempA{#3}% + \ifx\pst@tempA\pst@empty\psclip{\psframe(#2)}\else\psclip{#3}\fi + \pst@getcoor{#1}\pst@tempA + \pst@getcoor{#2}\pst@tempB + \begin@SpecialObj + \addto@pscode{ + \pst@tempA\space /yMin exch def + /xMin exch def + \pst@tempB\space /yMax exch def + /xMax exch def + /dy yMax yMin sub def + /dx xMax xMin sub def + rrand srand % initializes the random generator + /getRandReal { rand 2147483647 div } def + \psk@randomPoints { + /DS \pst@number\pssizeStar\space getRandReal mul def + \@nameuse{psds@\psk@dotstyle} + \ifPst@color getRandReal 1 1 sethsbcolor \fi + getRandReal dx mul xMin add + getRandReal dy mul yMin add + Dot + \ifx\psk@fillstyle\psfs@solid fill \fi stroke + } repeat + }% + \end@SpecialObj + \endpsclip + \ignorespaces +} +\makeatother +%%%%%%%%%%%%%%%%%% +%timeline +\begin{filecontents}{kepler16Nasa.dat} +::0x0 +::1 +::2 +::3 +::4 +::5 +::6 +::7 +::8 +::9 +::10 +::11 +::12 +::13 +::14 +::15 +::16 +::17 +::18 +::19 +::20 +::21 +::22 +::23 +::24 +::25 +::26 +::27 +::28 +::29 +::30 +::31 +::32 +::33 +::34 +::35 +::36 +::37 +::38 +::39 +::40 +::41 +::42 +::43 +::44 +::45 +::46 +::47 +::48 +::49 +::50 +::51 +::52 +::53 +::54 +::55 +::56 +::57 +::58 +::59 +::60 +::61 +::62 +::63 +::64 +::65 +::66 +::67 +::68 +::69 +::70 +::71 +::72 +::73 +::74 +::75 +::76 +::77 +::78 +::79 +::80 +::81 +::82 +::83 +::84 +::85 +::86 +::87 +::88 +::89 +::90 +::91 +::92 +::93 +::94 +::95 +::96 +::97 +::98 +::99 +::100 +::101 +::102 +::103 +::104 +::105 +::106 +::107 +::108 +::109 +::110 +::111 +::112 +::113 +::114 +::115 +::116 +::117 +::118 +::119 +::120 +::121 +::122 +::123 +::124 +::125 +::126 +::127 +::128 +::129 +::130 +::131 +::132 +::133 +::134 +::135 +::136 +::137 +::138 +::139 +::140 +::141 +::142 +::143 +::144 +::145 +::146 +::147 +::148 +::149 +::150 +::151 +::152 +::153 +::154 +::155 +::156 +::157 +::158 +::159 +::160 +::161 +::162 +::163 +::164 +::165 +::166 +::167 +::168 +::169 +::170 +::171 +::172 +::173 +::174 +::175 +::176 +::177 +::178 +::179 +::180 +::181 +::182 +::183 +::184 +::185 +::186 +::187 +::188 +::189 +::190 +::191 +::192 +::193 +::194 +::195 +::196 +::197 +::198 +::199 +::200 +::201 +::202 +::203 +::204 +::205 +::206 +::207 +::208 +::209 +::210 +::211 +::212 +::213 +::214 +::215 +::216 +::217 +::218 +::219 +::220 +::221 +::222 +::223 +::224 +::225 +::226 +::227 +::228 +::229 +::230 +::231 +\end{filecontents} +\title{Gravitation : une planète à deux soleils - animation \textsc{Nasa}} +\date{17 juillet 2\,012} +\begin{document} +%\section{L'animation à partir des données de la \textsc{Nasa}} +\maketitle +\begin{center} +\def\nFrames{230}% 230 images (229 jours) +\begin{animateinline}[controls,timeline=kepler16Nasa.dat,loop,% + begin={\begin{pspicture}(-8,-8)(8,8)}, + end={\end{pspicture}}]{10}% 10 images/s +\pstVerb{% +/Pi 3.14159265359 def +/2Pi 6.28318530718 def +% les angles doivent être en degrés +% pour calculer les sinus, cosinus +% en postscript +/rad2deg { 180 mul Pi div } bind def % radians -> degrés +/deg2rad { 180 div Pi mul } bind def % degrés -> radians +/tan {dup sin exch cos div} def + /arctan { + dup 0 ge + {1 atan} + {neg 1 atan neg} + ifelse + } def +/AV { % anomalie vraie + 1 exc add 1 exc sub div sqrt AE rad2deg 2 div tan mul arctan 2 mul + } def +/mA 0.6897 def % masse étoile A +/mB 0.20255 def% masse étoile B +/mt mA mB add def % masse totale +/mP 3e-4 def % masse planète +/a1 0.22431 def % a pour le point réduit +/e1 0.15944 def % excentricité +/p1 a1 1 e1 dup mul sub mul def % paramètre +/pA p1 mB mul mt div def % paramètre star A +/pB p1 mA mul mt div def % paramètre star B +/e2 0.0069 def % excentricité planète +/a2 0.7048 def % demi-grand axe planète +/w1 263.464 def % arguument +/w2 318 def % arguument planète +/p2 a2 1 e2 dup mul sub mul def % paramètre planète +% t T e Kepler -> AE +% date periode excentricité -> Kepler -> anomalie excentrique +/Kepler { + /exc exch def + /Ti exch def + /ti exch def + /AM ti 2Pi mul Ti div def % anomalie moyenne à la date t + /AE AM def % valeur initiale de anomalie excentrique + 5 {% 5 boucles + /AETemp % anomalie excentrique provisoire + AM exc rad2deg AE sin mul add + def + /AE AETemp def + } repeat + }def +% étoiles A et B +% T=41.076 jours e=0.15944 +% planète +% T=228.776 j e=0.0069 +% on calcule sur la periode la planète +% on construit les tableaux des positions +% à 1 jour d'intervalle +/tabStarA [ + 0 1 229 {/i exch def + i 41.076 e1 Kepler + /radius pA 1 e1 AV cos mul add div neg def + radius AV w1 add cos mul + radius AV w1 add sin mul + } for + ] def +/tabStarB [ + 0 1 229 {/i exch def + i 41.076 e1 Kepler + /radius pB 1 e1 AV cos mul add div def + radius AV w1 add cos mul + radius AV w1 add sin mul + } for + ] def + /tabPlanet [ + 0 1 229 {/i exch def + i 228.776 e2 Kepler + /radius p2 1 e2 AV cos mul add div def + radius AV w2 add cos mul + radius AV w2 add sin mul + } for + ] def + }% +\psframe*[linecolor={[cmyk]{1 1 0 0.7}}](-8,-8)(8,8) +\psRandomStar[linecolor={[rgb]{1,1,0.5}}, + randomPoints=1000,sizeStar=1pt](-8,-8)(8,8){\psframe[linestyle=none](-8,-8)(8,8)} +%\listplot[unit=10,linecolor=gray]{tabStarA aload pop} +%\listplot[unit=10,linecolor=gray]{tabStarB aload pop} +%\listplot[unit=10,linecolor=gray]{tabPlanet aload pop} +\newframe +\multiframe{\nFrames}{i=0+2}{% +\pstVerb{/i1 \i\space def + /xA tabStarA i1 get 10 mul def + /yA tabStarA i1 1 add get 10 mul def + /xB tabStarB i1 get 10 mul def + /yB tabStarB i1 1 add get 10 mul def + /xP tabPlanet i1 get 10 mul def + /yP tabPlanet i1 1 add get 10 mul def + }% +\pscircle[linestyle=none,fillstyle=gradient,gradmidpoint=0,gradend=yellow,GradientCircle=true,gradbegin=yellow!50!red!50](!xA yA){0.6} +\pscircle[linestyle=none,fillstyle=gradient,gradmidpoint=0,gradend=red,GradientCircle=true,gradbegin=red!50](!xB yB){0.2} +\pscircle*[linecolor=white](!xP yP){0.1} +} +\end{animateinline} +\end{center} +\end{document} +