Chargement des fichiers du répertoire lorenz
[pst-eqdf.git] / lorenz / Lorenz-PSTricks.tex
1 \documentclass{article}
2 \usepackage[a4paper,margin=2cm]{geometry}
3 \usepackage[T1]{fontenc}
4 \usepackage[latin1]{inputenc}%
5 \usepackage[garamond]{mathdesign}
6 \renewcommand{\ttdefault}{lmtt}
7 \usepackage{pst-node,pst-eqdf}
8 \usepackage{amsmath}
9 \usepackage{url}
10 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11 % Essai de Manuel Luque 19 février 2003
12 % transformé par Denis Girou le 25 février 2003
13 % révision le 14 septembre 2011
14 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
15 \makeatletter
16 \pst@addfams{pst-plothsb}
17
18 \define@key[psset]{pst-plothsb}{HueBegin}{% Between 0 and 1
19 \edef\PstParametricplotHSB@HueBegin{#1}}
20
21 \define@key[psset]{pst-plothsb}{HueEnd}{% Between 0 and 1
22 \edef\PstParametricplotHSB@HueEnd{#1}}
23
24 \newif\ifPst@HSB
25 \define@key[psset]{pst-plothsb}{HSB}[true]{\@nameuse{Pst@HSB#1}}
26
27 % Default values
28 \psset{HueBegin=0,HueEnd=1,HSB=true}
29
30 \def\parametricplotHSB{\pst@object{parametricplotHSB}}
31 \def\parametricplotHSB@i{\@ifnextchar[{\parametricplotHSB@do}{\parametricplotHSB@do[]}}
32 \def\parametricplotHSB@do[#1]#2#3#4{{%
33 \psset{#1}%
34 \begin@ClosedObj
35 \addto@pscode{%
36 /t #2 def
37 /dt #3 t sub \psk@plotpoints\space div def
38 /t t dt sub def
39 /Counter 0 def
40 \psk@plotpoints {
41 /t t dt add def
42 /Counter Counter 1 add def
43 /F@pstplot \ifPst@algebraic (#4)
44 tx@AlgToPs begin AlgToPs end cvx
45 \else { #4 }
46 \fi
47 def
48 \ifPst@algebraic
49 F@pstplot
50 \else #4
51 \fi
52 \pst@number\psyunit mul exch
53 \pst@number\psxunit mul exch
54 1 Counter eq
55 {moveto} % First point
56 {\ifPst@HSB % Other points than the first one
57 /PointY exch def
58 /PointX exch def
59 Counter \psk@plotpoints\space div
60 \PstParametricplotHSB@HueEnd\space
61 \PstParametricplotHSB@HueBegin\space sub mul
62 \PstParametricplotHSB@HueBegin\space add
63 1 1 sethsbcolor
64 PointX PointY lineto
65 stroke
66 PointX PointY moveto
67 \else
68 lineto
69 \fi} ifelse
70 } repeat}% fin du code ps
71 \end@ClosedObj}} % fin de la commande PSTricks
72
73 \makeatother
74
75 \makeatletter
76 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
77 % adaptation de \parametricplotHSB
78 % à \lisplotHSB
79 % le 10 juin 2012
80 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
81 \def\listplotHSB{\pst@object{listplotHSB}}
82 \def\listplotHSB@i#1{%
83 \begin@ClosedObj
84 \addto@pscode{%
85 /Counter 0 def
86 /XY [ #1 ] def
87 XY 0 get
88 XY 1 get
89 \pst@number\psyunit mul exch
90 \pst@number\psxunit mul exch
91 moveto
92 /L XY length def
93 2 2 L 2 sub {/i exch def
94 /x1 XY i get \pst@number\psxunit mul def
95 /y1 XY i 1 add get \pst@number\psyunit mul def
96 x1 y1
97 \ifPst@HSB
98 Counter L 2 div div
99 \PstParametricplotHSB@HueEnd\space
100 \PstParametricplotHSB@HueBegin\space sub mul
101 \PstParametricplotHSB@HueBegin\space add
102 1 1 sethsbcolor
103 /Counter Counter 1 add def
104 \fi
105 lineto
106 stroke
107 x1 y1 moveto
108 } for
109 }%
110 \end@ClosedObj}
111 \makeatother
112 \def\formules{%
113 /xObservateur abscisse Sin1 mul neg ordonnee Cos1 mul add def
114 /yObservateur abscisse Cos1Sin2 mul neg ordonnee Sin1Sin2 mul sub cote Cos2 mul add def
115 /zObservateur abscisse neg Cos1Cos2 mul ordonnee Sin1Cos2 mul sub cote Sin2 mul sub Dobs add def
116 /xScreen DScreen xObservateur mul zObservateur div def
117 /yScreen DScreen yObservateur mul zObservateur div def
118 xScreen yScreen}
119
120 \makeatletter
121 \pst@addfams{pst-pnodeTroisD}
122
123 \define@key[psset]{pst-pnodeTroisD}{THETA}{\edef\psk@TroisD@Theta{#1 }}
124 \define@key[psset]{pst-pnodeTroisD}{PHI}{\edef\psk@TroisD@Phi{#1 }}
125 \define@key[psset]{pst-pnodeTroisD}{Dobs}{\edef\psk@TroisD@Dobs{#1 }}
126 \define@key[psset]{pst-pnodeTroisD}{Decran}{\edef\psk@TroisD@Ecran{#1 }}
127 \psset{THETA=300,PHI=20,Dobs=200,Decran=25}
128 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
129 \def\pnodeTroisD{\@ifnextchar[{\pst@pnodeTroisD}{\pst@pnodeTroisD[]}}
130
131 \def\pst@pnodeTroisD[#1](#2,#3,#4)#5{{%
132 \pst@killglue
133 \psset{#1}%
134 \pnode(!
135 /THETA \psk@TroisD@Theta\space def
136 /PHI \psk@TroisD@Phi\space def
137 /Dobs \psk@TroisD@Dobs\space def
138 /DScreen \psk@TroisD@Ecran\space def
139 /Sin1 THETA sin def
140 /Sin2 PHI sin def
141 /Cos1 THETA cos def
142 /Cos2 PHI cos def
143 /Cos1Sin2 Cos1 Sin2 mul def
144 /Sin1Sin2 Sin1 Sin2 mul def
145 /Cos1Cos2 Cos1 Cos2 mul def
146 /Sin1Cos2 Sin1 Cos2 mul def
147 /xObservateur #2 Sin1 mul neg #3 Cos1 mul add def
148 /yObservateur #2 Cos1Sin2 mul neg #3 Sin1Sin2 mul sub #4 Cos2 mul add def
149 /zObservateur #2 neg Cos1Cos2 mul #3 Sin1Cos2 mul sub #4 Sin2 mul sub Dobs add def
150 /xScreen DScreen xObservateur mul zObservateur div def
151 /yScreen DScreen yObservateur mul zObservateur div def
152 xScreen yScreen){#5}}}
153 \makeatother
154 \title{L'attracteur de Lorenz avec PSTricks}
155 \date{12 juin 2012}
156 \begin{document}
157 \maketitle
158 \section{Présentation}
159 Ceci n'est pas un cours sur l'attracteur de Lorenz, il existe sur internet un grand nombre de sites qui lui sont consacrés très complets et d'une grande qualité pédagogique. Il s'agit, plus simplement, de montrer que l'utilisation de PSTricks permet d'illustrer ce modèle très convenablement.
160
161 Pour résoudre numériquement le système de Lorenz :
162 \[
163 \left\{
164 \begin{array}{rcl}
165 \dfrac{\mathrm{d}x}{\mathrm{d}t}&=&\sigma(x-y)\\
166 \dfrac{\mathrm{d}y}{\mathrm{d}t}&=&rx-y-z\\
167 \dfrac{\mathrm{d}z}{\mathrm{d}t}&=&xy-\beta z
168 \end{array}
169 \right.
170 \]
171 j'utilise une version très simplifiée de la macro \verb+\psplotDiffEqn+ de Dominique Rodriguez qui est incluse dans le package \verb+pstricks-add+, mais qui était, à l'origine, un package `\verb+pst-eqdf+' à elle seule. Dominique m'a donné la permission de modifier sa macro afin de pouvoir sauvegarder dans un tableau \verb+postscript+, et/ou dans un fichier, toutes les valeurs nécessaires au dessin des figures et en particulier à la représentation en 3D du \textit{papillon }de Lorenz. Cette macro simplifiée, qui utilise la méthode Runge-Kutta~4 est incluse dans un tout petit package dont j'ai gardé le même nom \verb+pst-eqdf+, mais la macro a changé de nom \verb+\psequadiff+ car elle ne trace plus les fonctions directement.
172
173 Pour les couleurs, j'utilise une macro \verb+\listplotHSB+ qui est un complément à celle-ci : \verb+\parametricplotHSB+\footnote{\url{http://melusine.eu.org/syracuse/G/pstricks/courbes-arc-en-ciel/}}, que nous avions mise au point avec Denis Girou.
174
175 \section{Les étapes de la construction des figures}
176 \subsection{Équations, paramètres et conditions initiales}
177 Il faut d'abord définir les équations en notation algébrique pour la macro \verb+\psequadiff+ :
178 \begin{verbatim}
179 % y[0] y[1] y[2]
180 % x y z
181 \def\Lorenz{
182 Pr*(y[1]-y[0])|%
183 Rh*y[0]-y[1]-y[0]*y[2]|%
184 y[0]*y[1]-b*y[2]%
185 }
186 \end{verbatim}
187 ainsi que les paramètres :
188 \begin{verbatim}
189 \def\parametres{
190 /Pr 10 def
191 /Rh 28 def
192 /b 8 3 div def
193 }%
194 \end{verbatim}
195 puis les conditions initiales :
196 \begin{verbatim}
197 x0 y0 z0
198 \def\conditionsInitiales{10 10 30}
199 \end{verbatim}
200 Ce sont ces deux dernières définitions qu'il faudra modifier si on veut changer les conditions initiales et les paramètres.
201 \subsection{L'utilisation de la commande \textbackslash{}psequadiff}
202 \begin{verbatim}
203 \pstVerb{\parametres}%
204 \psequadiff[% x,y
205 tabname=tabXY,
206 method=rk4,
207 whichabs=0,whichord=1,
208 saveData,filename=LorenzXY.dat,
209 plotpoints=2501,algebraic]{0}{25}{\conditionsInitiales}{\Lorenz}
210 \end{verbatim}
211 Dans cet exemple, l'intervalle de temps choisi est de 0 à 25 s. Les grandeurs prises sur la pile sont $(x,y)$. Le nombre de points calculés vaut 2501.
212 Les valeurs, sur cet intervalle de temps, sont stockées dans le tableau \verb+postscript+ : \textsf{[\textbf{tabname}=tabXY]} avec \textsf{tabXY} qui est le nom que l'on choisit soi-même.
213
214 Pour ne pas refaire le calcul, on peut choisir d'enregistrer la liste de valeurs du couple $(x,y)$, en positionnant le booléen \textsf{[saveData]} à true, on choisit un nom pour le fichier avec : \textsf{[\textbf{filename}=LorenzXY.dat]}. Par défaut, aucun fichier n'est enregistré.
215 \begin{verbatim}
216 saveData,filename=LorenzXY.dat,
217 \end{verbatim}
218 Pour utiliser ce fichier, il suffit de faire :
219 \begin{verbatim}
220 \pstVerb{/XY {(LorenzXY.dat) run } def}%
221 \listplotHSB{XY}
222 \end{verbatim}
223 Vous pouvez utiliser la commande \textbf{\textsf{lisplot}} du package \textsf{pst-plot} qui offre davantage d'options que \textsf{\textbf{listplotHSB}}.
224 \subsection{Le tracé de la courbe}
225 \begin{verbatim}
226 \listplotHSB[unit=0.25]{tabXY aload pop}%
227 \end{verbatim}
228 \verb+\listplotHSB+ permet de faire varier la couleur tout au long du tracé. Par défaut le paramètre \textsf{hue} de la définition d'une couleur dans le système \textsf{hsb} varie de 0 à 1. On peut fixer la plage de valeurs avec les 2 options suivantes :
229 \begin{itemize}
230 \item \textsf{\textbf{HueBegin}} avec une valeur comprise entre 0 et 1.
231 \item \textsf{\textbf{HueEnd}} avec une valeur comprise entre 0 et 1.
232 \end{itemize}
233 Pour avoir une couleur uniforme tout au long du tracé, il faut désactiver l'option \textsf{[\textbf{HSB}=false]} ainsi le tracé prendra la couleur que vous avez choisie avec l'option habituelle \textsf{linecolor}.
234 \section{Le tracé des courbes}
235 \subsection{Le tracé de XY}
236 % y[0] y[1] y[2]
237 % x y z
238 \def\Lorenz{
239 Pr*(y[1]-y[0])|%
240 Rh*y[0]-y[1]-y[0]*y[2]|%
241 y[0]*y[1]-beta*y[2]%
242 }
243 \def\conditionsInitiales{10 10 30}
244 \def\parametres{
245 /Pr 10 def
246 /Rh 28 def
247 /beta 8 3 div def
248 }%
249 \begin{center}
250 \begin{pspicture}(-8,-6)(8,8)
251 \psgrid[subgriddiv=0,gridcolor=lightgray,griddots=10,gridlabels=0pt]%
252 \pstVerb{\parametres}%
253 \psequadiff[% x,y
254 tabname=tabXY,
255 method=rk4,
256 whichabs=0,whichord=1,
257 saveData,filename=LorenzXY.dat,
258 plotpoints=2501,algebraic]{0}{25}{\conditionsInitiales}{\Lorenz}
259 \listplotHSB[unit=0.25]{tabXY aload pop}%
260 \uput[r](8,0){$x$}
261 \uput[u](0,8){$y$}
262 \end{pspicture}
263 \end{center}
264 \begin{verbatim}
265 \begin{pspicture}(-8,-6)(8,8)
266 \psgrid[subgriddiv=0,gridcolor=lightgray,griddots=10,gridlabels=0pt]%
267 \pstVerb{\parametres}%
268 \psequadiff[% x,y
269 tabname=tabXY,
270 method=rk4,
271 whichabs=0,whichord=1,
272 saveData,filename=LorenzXY.dat,
273 plotpoints=2501,algebraic]{0}{25}{\conditionsInitiales}{\Lorenz}
274 \listplotHSB[unit=0.25]{tabXY aload pop}%
275 \uput[r](8,0){$x$}
276 \uput[u](0,8){$y$}
277 \end{pspicture}
278 \end{verbatim}
279 \subsection{Le tracé de X(t)}
280 \begin{center}
281 \begin{pspicture}(0,-5)(13,5.5)
282 \psgrid[subgriddiv=0,gridcolor=lightgray,griddots=10,gridlabels=0pt](0,-5)(13,5)%
283 \pstVerb{\parametres}%
284 \psequadiff[% t,x
285 tabname=tabtX,
286 method=rk4,
287 whichord=0,
288 saveData,filename=LorenztX.dat,
289 plotpoints=2501,algebraic]{0}{25}{\conditionsInitiales}{\Lorenz}
290 \listplotHSB[yunit=0.2,xunit=0.5,HSB=false]{tabtX aload pop}%
291 \uput[r](13,0){$t$}
292 \uput[u](0,5){$x$}
293 \psline{<->}(13,0)(0,0)(0,5)
294 \end{pspicture}
295 \end{center}
296 \begin{verbatim}
297 \begin{pspicture}(0,-5)(13,5)
298 \psgrid[subgriddiv=0,gridcolor=lightgray,griddots=10,gridlabels=0pt]%
299 \pstVerb{\parametres}%
300 \psequadiff[% t,x
301 tabname=tabtX,
302 method=rk4,
303 whichord=0,
304 saveData,filename=LorenztX.dat,
305 plotpoints=2501,algebraic]{0}{25}{\conditionsInitiales}{\Lorenz}
306 \listplotHSB[yunit=0.2,xunit=0.5,HSB=false]{tabtX aload pop}%
307 \uput[r](12.5,0){$t$}
308 \uput[u](0,5){$x$}
309 \end{pspicture}
310 \end{verbatim}
311 \subsection{Le tracé de XZ}
312 \begin{center}
313 \begin{pspicture}(-8,0)(8,12)
314 \psgrid[subgriddiv=0,gridcolor=lightgray,griddots=10,gridlabels=0pt]%
315 \pstVerb{\parametres}%
316 \psequadiff[% x,z
317 tabname=tabXZ,
318 method=rk4,
319 whichabs=0,
320 whichord=2,
321 saveData,filename=LorenzXZ.dat,
322 plotpoints=2501,algebraic]{0}{25}{\conditionsInitiales}{\Lorenz}
323 \listplotHSB[linecolor=green,unit=0.25,HueBegin=.25,HueEnd=0.65]{tabXZ aload pop}%
324 \uput[r](8,0){$x$}
325 \uput[u](0,12){$z$}
326 \end{pspicture}
327 \end{center}
328 \begin{verbatim}
329 \begin{pspicture}(-8,0)(8,12)
330 \psgrid[subgriddiv=0,gridcolor=lightgray,griddots=10,gridlabels=0pt]%
331 \pstVerb{\parametres}%
332 \psequadiff[% x,z
333 tabname=tabXZ,
334 method=rk4,
335 whichabs=0,
336 whichord=2,
337 saveData,filename=LorenzXZ.dat,
338 plotpoints=2501,algebraic]{0}{25}{\conditionsInitiales}{\Lorenz}
339 \listplotHSB[linecolor=green,unit=0.25,HueBegin=.25,HueEnd=0.65]{tabXZ aload pop}%
340 \uput[r](8,0){$x$}
341 \uput[u](0,12){$z$}
342 \end{pspicture}
343 \end{verbatim}
344 \subsection{Le tracé de YZ}
345 \begin{center}
346 \begin{pspicture}(-8,0)(8,12)
347 \psgrid[subgriddiv=0,gridcolor=lightgray,griddots=10,gridlabels=0pt]%
348 \pstVerb{\parametres}%
349 \psequadiff[% y,z
350 tabname=tabYZ,
351 method=rk4,
352 whichabs=1,
353 whichord=2,
354 saveData,filename=LorenzYZ.dat,
355 plotpoints=2501,algebraic]{0}{25}{\conditionsInitiales}{\Lorenz}
356 \listplotHSB[linecolor=magenta,unit=0.25,HueBegin=0.65,HueEnd=1]{tabYZ aload pop}%
357 \uput[r](8,0){$y$}
358 \uput[u](0,12){$z$}
359 \end{pspicture}
360 \end{center}
361 \begin{verbatim}
362 \begin{pspicture}(-8,0)(8,12)
363 \psgrid[subgriddiv=0,gridcolor=lightgray,griddots=10,gridlabels=0pt]%
364 \pstVerb{\parametres}%
365 \psequadiff[% y,z
366 tabname=tabYZ,
367 method=rk4,
368 whichabs=1,
369 whichord=2,
370 saveData,filename=LorenzYZ.dat,
371 plotpoints=2501,algebraic]{0}{25}{\conditionsInitiales}{\Lorenz}
372 \listplotHSB[linecolor=magenta,unit=0.25,HueBegin=0.65,HueEnd=1]{tabYZ aload pop}%
373 \uput[r](8,0){$y$}
374 \uput[u](0,12){$z$}
375 \end{pspicture}
376 \end{verbatim}
377 \subsection{Le tracé du papillon de Lorenz en 3D}
378 Le tracé en 3D est l'étape la plus délicate, puisqu'il faut réunir les fichiers $(x,y)$, $(x,z)$ et $(y,z)$ en un seul fichier $(x,y,z)$. Ce qu'on réalise ainsi :
379 \begin{verbatim}
380 \pstVerb{/XY [(LorenzXY.dat) run ] def
381 /XZ [(LorenzXZ.dat) run ] def
382 /YZ [(LorenzYZ.dat) run ] def
383 /tabXYZ [
384 0 2 XY length 2 sub {/i exch def
385 [ XY i get
386 XY i 1 add get
387 YZ i 1 add get
388 ]
389 } for
390 ]def
391 /fichierpoints (XYZLorenz.dat) (w) file def
392 0 1 tabXYZ length 1 sub {/i exch def
393 tabXYZ i get aload pop
394 /zi exch def
395 /yi exch def
396 /xi exch def
397 fichierpoints xi 15 string cvs writestring
398 fichierpoints 32 write %% espace
399 fichierpoints yi 15 string cvs writestring
400 fichierpoints 32 write %% espace
401 fichierpoints zi 15 string cvs writestring
402 fichierpoints 10 write %% CR
403 } for
404 fichierpoints closefile
405 \end{verbatim}
406 Les dernières lignes permettent d'enregistrer, si on le souhaite, le fichier de points.
407 \begin{center}
408 \begin{pspicture}(-6,-4)(6,12)
409 \psset{THETA=-70,PHI=20,Dobs=2000,Decran=400}
410 \pstVerb{/XY [(LorenzXY.dat) run ] def
411 /XZ [(LorenzXZ.dat) run ] def
412 /YZ [(LorenzYZ.dat) run ] def
413 /tabXYZ [
414 0 2 XY length 2 sub {/i exch def
415 [ XY i get
416 XY i 1 add get
417 YZ i 1 add get
418 ]
419 } for
420 ]def
421 /fichierpoints (XYZLorenz.dat) (w) file def
422 0 1 tabXYZ length 1 sub {/i exch def
423 tabXYZ i get aload pop
424 /zi exch def
425 /yi exch def
426 /xi exch def
427 fichierpoints xi 15 string cvs writestring
428 fichierpoints 32 write %% espace
429 fichierpoints yi 15 string cvs writestring
430 fichierpoints 32 write %% espace
431 fichierpoints zi 15 string cvs writestring
432 fichierpoints 10 write %% CR
433 } for
434 fichierpoints closefile
435 }%
436 \makeatletter
437 \pstVerb{
438 /THETA \psk@TroisD@Theta def
439 /PHI \psk@TroisD@Phi def
440 /Dobs \psk@TroisD@Dobs def
441 /DScreen \psk@TroisD@Ecran def
442 /Sin1 THETA sin def
443 /Sin2 PHI sin def
444 /Cos1 THETA cos def
445 /Cos2 PHI cos def
446 /Cos1Sin2 Cos1 Sin2 mul def
447 /Sin1Sin2 Sin1 Sin2 mul def
448 /Cos1Cos2 Cos1 Cos2 mul def
449 /Sin1Cos2 Sin1 Cos2 mul def
450 /IIID {
451 0 1 tabXYZ length 1 sub {/i exch def
452 /TAB tabXYZ i get def
453 /abscisse TAB 0 get def
454 /ordonnee TAB 1 get def
455 /cote TAB 2 get def
456 \formules} for
457 } def
458 }%
459 \makeatother
460 \listplotHSB[unit=1]{IIID}
461 \psset{unit=2.5,linestyle=dashed}
462 \pnodeTroisD(0,0,0){O}
463 \pnodeTroisD(0,0,5){Z}
464 \pnodeTroisD(5,0,0){X}
465 \pnodeTroisD(0,5,0){Y}
466 \pnodeTroisD(-10,-10,0){A}
467 \pnodeTroisD(-10,-10,20){B}
468 \pnodeTroisD(-10,10,20){C}
469 \pnodeTroisD(-10,10,0){D}
470 \pnodeTroisD(10,-10,0){E}
471 \pnodeTroisD(10,-10,20){F}
472 \pnodeTroisD(10,10,20){G}
473 \pnodeTroisD(10,10,0){H}
474 \pspolygon(A)(B)(C)(D)
475 \pspolygon(E)(F)(G)(H)
476 \psline(A)(E)
477 \psline(B)(F)
478 \psline(D)(H)
479 \psline(C)(G)
480 \psset{linestyle=solid,linecolor=red}
481 \psline{->}(O)(X)
482 \psline{->}(O)(Y)
483 \psline{->}(O)(Z)
484 \end{pspicture}
485 \end{center}
486 \newpage
487 Le tracé s'effectue grâce à la commande \verb+\pnodeTroisD+ et ses diverses options.
488 \begin{verbatim}
489 \makeatletter
490 \pstVerb{
491 /THETA \psk@TroisD@Theta def
492 /PHI \psk@TroisD@Phi def
493 /Dobs \psk@TroisD@Dobs def
494 /DScreen \psk@TroisD@Ecran def
495 /Sin1 THETA sin def
496 /Sin2 PHI sin def
497 /Cos1 THETA cos def
498 /Cos2 PHI cos def
499 /Cos1Sin2 Cos1 Sin2 mul def
500 /Sin1Sin2 Sin1 Sin2 mul def
501 /Cos1Cos2 Cos1 Cos2 mul def
502 /Sin1Cos2 Sin1 Cos2 mul def
503 /IIID {
504 0 1 tabXYZ length 1 sub {/i exch def
505 /TAB tabXYZ i get def
506 /abscisse TAB 0 get def
507 /ordonnee TAB 1 get def
508 /cote TAB 2 get def
509 \formules} for
510 } def
511 }%
512 \makeatother
513 \listplotHSB[unit=1]{IIID}
514 \psset{unit=2.5,linestyle=dashed}
515 \pnodeTroisD(0,0,0){O}
516 \pnodeTroisD(0,0,5){Z}
517 \pnodeTroisD(5,0,0){X}
518 \pnodeTroisD(0,5,0){Y}
519 \pnodeTroisD(-10,-10,0){A}
520 \pnodeTroisD(-10,-10,20){B}
521 \pnodeTroisD(-10,10,20){C}
522 \pnodeTroisD(-10,10,0){D}
523 \pnodeTroisD(10,-10,0){E}
524 \pnodeTroisD(10,-10,20){F}
525 \pnodeTroisD(10,10,20){G}
526 \pnodeTroisD(10,10,0){H}
527 \pspolygon(A)(B)(C)(D)
528 \pspolygon(E)(F)(G)(H)
529 \psline(A)(E)
530 \psline(B)(F)
531 \psline(D)(H)
532 \psline(C)(G)
533 \psset{linestyle=solid,linecolor=red}
534 \psline{->}(O)(X)
535 \psline{->}(O)(Y)
536 \psline{->}(O)(Z)
537 \end{verbatim}
538 \section{Animations avec le package animate}
539 En préparation.
540 \end{document}
541

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.