1 \documentclass{article
}
2 \usepackage[a4paper,margin=
2cm
]{geometry
}
4 \usepackage{pst-node,pst-eqdf
}
6 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
7 % Essai de Manuel Luque 19 février 2003
8 % transformé par Denis Girou le 25 février 2003
9 % révision le 14 septembre 2011
10 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
12 \pst@addfams
{pst-plothsb
}
14 \define@key
[psset
]{pst-plothsb
}{HueBegin
}{% Between 0 and 1
15 \edef\PstParametricplotHSB@HueBegin
{#1}}
17 \define@key
[psset
]{pst-plothsb
}{HueEnd
}{% Between 0 and 1
18 \edef\PstParametricplotHSB@HueEnd
{#1}}
21 \define@key
[psset
]{pst-plothsb
}{HSB
}[true
]{\@nameuse
{Pst@HSB
#1}}
24 \psset{HueBegin=
0,HueEnd=
1,HSB=true
}
26 \def\parametricplotHSB{\pst@object
{parametricplotHSB
}}
27 \def\parametricplotHSB@i
{\@ifnextchar
[{\parametricplotHSB@do
}{\parametricplotHSB@do
[]}}
28 \def\parametricplotHSB@do
[#1]#2#3#4{{%
33 /dt
#3 t sub
\psk@plotpoints
\space div def
38 /Counter Counter
1 add def
39 /F@pstplot
\ifPst@algebraic (
#4)
40 tx@AlgToPs begin AlgToPs end cvx
48 \pst@number
\psyunit mul exch
49 \pst@number
\psxunit mul exch
51 {moveto
} % First point
52 {\ifPst@HSB
% Other points than the first one
55 Counter
\psk@plotpoints
\space div
56 \PstParametricplotHSB@HueEnd
\space
57 \PstParametricplotHSB@HueBegin
\space sub mul
58 \PstParametricplotHSB@HueBegin
\space add
66 } repeat
}% fin du code ps
67 \end@ClosedObj
}} % fin de la commande PSTricks
72 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
73 % adaptation de \parametricplotHSB
76 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
77 \def\listplotHSB{\pst@object
{listplotHSB
}}
78 \def\listplotHSB@i
#1{%
85 \pst@number
\psyunit mul exch
86 \pst@number
\psxunit mul exch
89 2 2 L
2 sub
{/i exch def
90 /x1 XY@ i get
\pst@number
\psxunit mul def
91 /y1 XY@ i
1 add get
\pst@number
\psyunit mul def
95 \PstParametricplotHSB@HueEnd
\space
96 \PstParametricplotHSB@HueBegin
\space sub mul
97 \PstParametricplotHSB@HueBegin
\space add
99 /Counter Counter
1 add def
109 /xObservateur abscisse Sin1 mul neg ordonnee Cos1 mul add def
110 /yObservateur abscisse Cos1Sin2 mul neg ordonnee Sin1Sin2 mul sub cote Cos2 mul add def
111 /zObservateur abscisse neg Cos1Cos2 mul ordonnee Sin1Cos2 mul sub cote Sin2 mul sub Dobs add def
112 /xScreen DScreen xObservateur mul zObservateur div def
113 /yScreen DScreen yObservateur mul zObservateur div def
117 \pst@addfams
{pst-pnodeTroisD
}
119 \define@key
[psset
]{pst-pnodeTroisD
}{THETA
}{\edef\psk@TroisD@Theta
{#1 }}
120 \define@key
[psset
]{pst-pnodeTroisD
}{PHI
}{\edef\psk@TroisD@Phi
{#1 }}
121 \define@key
[psset
]{pst-pnodeTroisD
}{Dobs
}{\edef\psk@TroisD@Dobs
{#1 }}
122 \define@key
[psset
]{pst-pnodeTroisD
}{Decran
}{\edef\psk@TroisD@Ecran
{#1 }}
123 \psset{THETA=
300,PHI=
20,Dobs=
200,Decran=
25}
124 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
125 \def\pnodeTroisD{\@ifnextchar
[{\pst@pnodeTroisD
}{\pst@pnodeTroisD
[]}}
127 \def\pst@pnodeTroisD
[#1](
#2,
#3,
#4)
#5{{%
131 /THETA
\psk@TroisD@Theta
\space def
132 /PHI
\psk@TroisD@Phi
\space def
133 /Dobs
\psk@TroisD@Dobs
\space def
134 /DScreen
\psk@TroisD@Ecran
\space def
139 /Cos1Sin2 Cos1 Sin2 mul def
140 /Sin1Sin2 Sin1 Sin2 mul def
141 /Cos1Cos2 Cos1 Cos2 mul def
142 /Sin1Cos2 Sin1 Cos2 mul def
143 /xObservateur
#2 Sin1 mul neg
#3 Cos1 mul add def
144 /yObservateur
#2 Cos1Sin2 mul neg
#3 Sin1Sin2 mul sub
#4 Cos2 mul add def
145 /zObservateur
#2 neg Cos1Cos2 mul
#3 Sin1Cos2 mul sub
#4 Sin2 mul sub Dobs add def
146 /xScreen DScreen xObservateur mul zObservateur div def
147 /yScreen DScreen yObservateur mul zObservateur div def
148 xScreen yScreen)
{#5}}}
151 \begin{filecontents
}{lorenzxy.txt
}
205 \title{L'attracteur de Lorenz avec PSTricks
}
217 Rh*y
[0]-y
[1]-y
[0]*y
[2]|
%
220 \def\conditionsInitiales{10 10 30}
222 \begin{pspicture
}(-
8,-
.01)(
8,
0.01)
223 %\psgrid[subgriddiv=0,gridcolor=lightgray,griddots=10,gridlabels=0pt]%
224 \pstVerb{\parametres}%
228 whichabs=
0,whichord=
1,
229 saveData,filename=LorenzXY.dat,
230 plotpoints=
2501,algebraic
]{0}{25}{\conditionsInitiales}{\Lorenz}
231 %% une commande PSTricks est indispensable si on ne vaut pas tracer le courbe
232 \psdot[linecolor=white,dotsize=
0.001](
0,
0)
233 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
234 %\listplotHSB[unit=0.25]{tabXY aload pop}%
240 \def\nFrames{51}% 200 images
241 \pstVerb{/XYlorentz
[ (LorenzXY.dat) run
] def
}%
242 \begin{animateinline
}[controls,timeline=lorenzxy.txt,
%
243 begin=
{\begin{pspicture
}(-
8,-
6)(
8,
7)
},
244 end=
{\end{pspicture
}}]{10}% 10 images/s
245 \psgrid[subgriddiv=
0,gridcolor=lightgray,griddots=
10,gridlabels=
0pt
]%
246 \rput(
0,
6.5)
{\large\textbf{XY
}$(x_0=
10,y_0=
10,z_0=
30)$
}
247 \listplotHSB[unit=
0.25,HSB=false,linecolor=gray
]{XYlorentz aload pop
}%
249 \multiframe{\nFrames}{i=
0+
100}{% 1 point sur 10
250 \pstVerb{ /XYpartiel
{0 2 \i\space {/i exch def
252 XYlorentz i
1 add get
256 \listplotHSB[unit=
0.25,linewidth=
0.2]{XYpartiel
}%