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{{%
132 /THETA
\psk@TroisD@Theta
\space def
133 /PHI
\psk@TroisD@Phi
\space def
134 /Dobs
\psk@TroisD@Dobs
\space def
135 /DScreen
\psk@TroisD@Ecran
\space def
140 /Cos1Sin2 Cos1 Sin2 mul def
141 /Sin1Sin2 Sin1 Sin2 mul def
142 /Cos1Cos2 Cos1 Cos2 mul def
143 /Sin1Cos2 Sin1 Cos2 mul def
144 /xObservateur
#2 Sin1 mul neg
#3 Cos1 mul add def
145 /yObservateur
#2 Cos1Sin2 mul neg
#3 Sin1Sin2 mul sub
#4 Cos2 mul add def
146 /zObservateur
#2 neg Cos1Cos2 mul
#3 Sin1Cos2 mul sub
#4 Sin2 mul sub Dobs add def
147 /xScreen DScreen xObservateur mul zObservateur div def
148 /yScreen DScreen yObservateur mul zObservateur div def
149 xScreen yScreen)
{#5}}}
151 \let\pskTroisDTheta \psk@TroisD@Theta
152 \let\pskTroisDPhi \psk@TroisD@Phi
153 \let\pskTroisDDobs \psk@TroisD@Dobs
154 \let\pskTroisDEcran \psk@TroisD@Ecran
157 \title{L'attracteur de Lorenz avec PSTricks
}
169 Rh*y
[0]-y
[1]-y
[0]*y
[2]|
%
172 \def\conditionsInitiales{10 10 30}
174 \def\nFrames{51}% 200 images
175 \pstVerb{/XY
[(LorenzXY.dat) run
] def
176 /XZ
[(LorenzXZ.dat) run
] def
177 /YZ
[(LorenzYZ.dat) run
] def
179 0 2 XY length
2 sub
{/i exch def
186 \def\nFrames{72}% 72 images
187 \begin{animateinline
}[controls,loop,
%
188 begin=
{\begin{pspicture
}(-
8,-
3)(
8,
12)
},
189 end=
{\end{pspicture
}}]{5}% 5 images/s
190 \multiframe{\nFrames}{i=
0+
5}{% tous les 10 degres
191 \psframe*(-
8,-
4)(
8,
14)
192 \psset{THETA=
\i,PHI=
20,Dobs=
2000,Decran=
400}
194 /THETA
\pskTroisDTheta def
195 /PHI
\pskTroisDPhi def
196 /Dobs
\pskTroisDDobs def
197 /DScreen
\pskTroisDEcran def
204 /Cos1Sin2 Cos1 Sin2 mul def
205 /Sin1Sin2 Sin1 Sin2 mul def
206 /Cos1Cos2 Cos1 Cos2 mul def
207 /Sin1Cos2 Sin1 Cos2 mul def
209 0 1 tabXYZ length
1 sub
{/i exch def
210 /TAB tabXYZ i get def
211 /abscisse TAB
0 get def
212 /ordonnee TAB
1 get def
217 {\psset{unit=
2.5,linestyle=dashed,linecolor=white
}
218 \pnodeTroisD(
0,
0,
0)
{O
}
219 \pnodeTroisD(
0,
0,
5)
{Z
}
220 \pnodeTroisD(
5,
0,
0)
{X
}
221 \pnodeTroisD(
0,
5,
0)
{Y
}
222 \pnodeTroisD(-
10,-
10,
0)
{A
}
223 \pnodeTroisD(-
10,-
10,
20)
{B
}
224 \pnodeTroisD(-
10,
10,
20)
{C
}
225 \pnodeTroisD(-
10,
10,
0)
{D
}
226 \pnodeTroisD(
10,-
10,
0)
{E
}
227 \pnodeTroisD(
10,-
10,
20)
{F
}
228 \pnodeTroisD(
10,
10,
20)
{G
}
229 \pnodeTroisD(
10,
10,
0)
{H
}
230 \pspolygon(A)(B)(C)(D)
231 \pspolygon(E)(F)(G)(H)
236 \psset{linestyle=solid,linecolor=red
}
240 \listplotHSB[unit=
1,linewidth=
0.05]{IIID
}