Debian Codegraph @

texmf-dist/doc/latex/visualpstricks/Source/graph3.tex

raw
1
2
3
4 \subsection{Macro psplot }
5
6 %\TFRGB{syntaxe}{syntax} : \BSS{psplot} [Options] \AC{x min}\AC{x max}\AC{fonction}
7 %
8 %
9 %
10 % \bigskip
11
12
13 \psset{yunit=1cm}
14 \begin{center}
15 \begin{tabular}{|l|} \hline
16
17 \multicolumn{1}{|c|}{
18 \begin{psgraph*}[,xticksize= -1.5 1.5 ,yticksize=12cm , subticks=0, dx=90,Dx=90 , dy=.5,Dy=.5](0,0)(0,-1.5)(720,1.5){12cm}{5cm }
19 \psplot[plotpoints=200,linecolor=red]{0}{720}{x sin}
20 \end{psgraph*}
21 %\pspicture(0,-1.5)(8,1.50)
22 %\psset{xunit=0.01cm}
23 %\psplot[plotpoints=200,linecolor=red]{0}{720}{x sin}
24 %\psline{->}(800,0)
25 %\endpspicture
26 }\\ \hline
27 % \BS{}psset\AC{xunit=0.01cm}\\
28 \textbf{\BS{psplot}}[\rnode{A}{\RDD{plotpoints}=200},linecolor=red]\rnode{B}{\AC{0}\AC{720}}\rnode{C}{\AC{x sin}} \RDI{plotpoints}{pst-plot} \\ \hline
29 \\
30 \rnode{AA}{\TFRGB{ nombre de points utilisés}{number of point used}} \hspace{.5cm}
31 \rnode{BB}{\TFRGB{unité de x en degré}{x unit : degree}} \hspace{0.5cm}
32 \rnode{CC}{\TFRGB{fonction en langage PostScript \footnotemark[1]}{Function in postscript code }}
33 \\ \hline
34 {\blue \dft{} : plotpoints = 50 }
35 \\ \hline
36
37
38 \end{tabular}
39 \end{center}
40 \footnotetext[1]{\TFRGB{formule de calcul en langage PostScript (voir \pageref{postcript})}{formula in the PostScript language} }
41
42 \ncline[linecolor=blue]{A}{AA} \ncline[linecolor=blue]{B}{BB} \ncline[linecolor=blue]{C}{CC}
43
44
45 %-----------------------------------------------------
46 \subsection{Macro parametricplot}
47
48 %\TFRGB{syntaxe}{syntax} : \BSS{parametricplot} [Options]\AC{t min}\AC{t max}\AC{x(t) y(t) }
49 %\BSI{parametricplot}{pst-plot}
50 % \bigskip
51
52
53 %\BS{}psset\AC{xunit=2cm}\\
54
55
56 %
57 %\begin{psgraph*}[,xticksize= -2 2 ,yticksize=-2 2, subticks=0, dx=.5,Dx=.5, dy=.5,Dy=.5](0,0)(-2,-2)(2,2){5cm}{5cm }
58 %\parametricplot[linewidth=1.2pt,plotstyle=ccurve,linecolor=red]{0}{360}{t sin t 2 mul sin}
59 %\end{psgraph*}
60
61
62 \begin{center}
63 \begin{tabular}{|c|} \hline
64 \begin{psgraph*}[,xticksize= -1.5 1.5 ,yticksize=-1.5 1.5 , subticks=0, dx=.5,Dx=.5, dy=.5,Dy=.5](0,0)(-1.5,-1.5)(1.5,1.5){5cm}{5cm }
65 \parametricplot[linewidth=1.2pt,plotstyle=ccurve,linecolor=red]{0}{360}{t sin t 2 mul sin}
66 \end{psgraph*}
67 %
68 %\begin{pspicture}(-5cm,-1.5)(5cm,1.5)
69 %
70 %\psset{xunit=2cm}
71 %\parametricplot[linewidth=1.2pt,plotstyle=ccurve,linecolor=red]{0}{360}{t sin t 2 mul sin}
72 %\psline{<->}(0,-1.2)(0,1.2)
73 %\psline{<->}(-1.2,0)(1.2,0)
74 %\end{pspicture}
75 \\ \hline
76 \textbf{\BS{}parametricplot}[linewidth=1.2pt,plotstyle=ccurve,linecolor=red]\\
77 \rnode{A}{\AC{0}\AC{360}}\Rnode*[fillcolor=yellow,fillstyle=solid]{B}{\AC{t sin t 2 mul sin} }\hspace{1cm} (functions : $sin(t)$ et $sin(2t)$)\\
78 %\BS{psline}\AC{<->}(0,-1.2)(0,1.2)\\
79 %\BS{psline}\AC{<->}(-1.2,0)(1.2,0)\\
80 \hline
81 \\ \\
82 \rnode{AA}{\TFRGB{L'unité de t est le degré }{ t unit in degree}} \hspace{1cm}
83 \rnode{BB}{\TFRGB{Les deux fonctions doivent être écrites en langage PostScript }{the 2 functions in postcript code } !}
84 \\ \hline
85 \end{tabular}
86 \end{center}
87 \ncline[linecolor=blue]{A}{AA} \ncline[linecolor=blue,armA=.5cm,angleA=90]{B}{BB}
88
89 \newpage
90
91 %=====================================================
92 \SbSSCT{Graphe polaire}{Polar graph}
93
94 %\TFRGB{syntaxe}{syntax} :
95 %\BS{}psplot [\RDD{polarplot}=true]\AC{angle début}\AC{angle fin}[commande postscript]\AC{équation} \RDI{polarplot}{pst-plot}
96
97 %Exemple :
98
99
100
101 %\AC{}psplot[plotstyle=curve,polarplot=true,linecolor=red,algebraic=true]\AC{0}\AC{\BS{}psPiTwo}\AC{6*sin(2*x)}
102
103 %\begin{psgraph*}[axesstyle=none,xticksize= -5 5 ,yticksize=-5 5, subticks=0](0,0)(-5,-5)(5,5){5cm}{5cm }
104 %\psplot[plotstyle=curve,polarplot=true,linecolor=red]{0}{360}{ x 2 mul sin 6 mul }
105 %\end{psgraph*}
106
107 \begin{center}
108 \begin{tabular}{|c|} \hline
109 \begin{psgraph*}[xticksize= -5 5 ,yticksize=-5 5, subticks=0](0,0)(-5,-5)(5,5){5cm}{5cm }
110 \psplot[plotstyle=curve,polarplot=true,linecolor=red]{0}{360}{ x 2 mul sin 6 mul }
111 \end{psgraph*}
112 \\ \hline
113 \BS{}psplot[plotstyle=curve,{\red polarplot}=true,linecolor=red]\\
114 \AC{0}\AC{360} \AC{ x 2 mul sin 6 mul } \\ \hline ($6*sin(2*x)$)\\ \hline
115 \end{tabular}
116 \end{center}
117
118 %\psplot[plotstyle=curve,polarplot=true,linecolor=red,algebraic=true]{0}{\psPiTwo}{6*sin(2*x)}
119
120
121 \subsection{Modules infix-RPN et pst-infixplot \cite{pst-infix}}
122 % \begin{itemize}
123 % \item Ces Modules permettent de s'affranchir des équations en langage PostScript
124 % \item Le module infix-RPN utilise \BS{RPN}
125 % \item Le module pst-infixplot donne les commandes \BS{}psPlot et \BS{}parametricPlot
126 %\end{itemize}
127 %
128 %
129 %\bigskip
130 %Exemples :
131 \label{infix-RPN}
132 \label{pst-infixplot}
133
134 %% \multicolumn{1}{|c|}{
135 % \begin{psgraph*}[,xticksize= -1.5 1.5 ,yticksize=12cm , subticks=0, dx=90,Dx=90 , dy=.5,Dy=.5](0,0)(0,-1.5)(720,1.5){12cm}{5cm }
136 %\infixtoRPN{sin(x)}
137 %\psplot[plotpoints=200,linecolor=red]{0}{720}{\RPN}
138 % \end{psgraph*}
139 %%\pspicture(0,-1.5)(8,1.50)
140 %%\psset{xunit=0.01cm}
141 %%\psplot[plotpoints=200,linecolor=red]{0}{720}{x sin}
142 %%\psline{->}(800,0)
143 %%\endpspicture
144 %%}
145
146
147 \begin{center}
148 \begin{tabular}{|l|} \hline
149 \begin{psgraph*}[,xticksize= -1.5 1.5 ,yticksize=12cm , subticks=0, dx=90,Dx=90 , dy=.5,Dy=.5](0,0)(0,-1.5)(720,1.5){10cm}{3cm }
150 \infixtoRPN{sin(x)}
151 \psplot[plotpoints=200,linecolor=red]{0}{720}{\RPN}
152 \end{psgraph*}
153 %\pspicture(0,-1.5)(9cm,1.50)
154 %\psset{xunit=0.01cm}
155 %\infixtoRPN{sin(x)}
156 %\psplot[plotpoints=200,linecolor=red]{0}{720}{\RPN}
157 %\psline{->}(800,0)
158 %\endpspicture
159 \\ \hline
160 \BSS{infixtoRPN}\AC{sin(x)} \BSI{infixtoRPN}{pst-plot} \\
161 \BS{}psplot[plotpoints=200]\AC{0}\AC{720}\AC{{\red \BS{}RPN}}
162 \\ \hline
163 \end{tabular}
164 \end{center}
165
166
167
168 \smallskip
169 \begin{center}
170 \begin{tabular}{|l|} \hline
171 \begin{psgraph*}[,xticksize= -1.5 1.5 ,yticksize=12cm , subticks=0, dx=90,Dx=90 , dy=.5,Dy=.5](0,0)(0,-1.5)(720,1.5){10cm}{3cm }
172 \psPlot[linecolor=red]{0}{720}{sin(x)}
173 \end{psgraph*}
174
175 %\pspicture(0,-1.1)(9cm,1.1)
176 %\psset{xunit=0.01cm}
177 %\psset{plotpoints=200}
178 %\psPlot[linecolor=red]{0}{720}{sin(x)}
179 %\psline{->}(8cm,0)
180 %\endpspicture
181 \\ \hline
182 %\BS{}psset\AC{plotpoints=200} \\
183 \BSS{psPlot}\AC{0}\AC{720}\AC{sin(x)}
184 \\ \hline
185 \end{tabular}
186 \end{center}
187
188
189
190
191 \smallskip
192 \begin{center}
193 \begin{tabular}{|c|} \hline
194 \begin{psgraph*}[,xticksize= -1.5 1.5 ,yticksize=-1.5 1.5 , subticks=0, dx=.5,Dx=.5, dy=.5,Dy=.5](0,0)(-1.5,-1.5)(1.5,1.5){5cm}{5cm }
195 \parametricPlot[linecolor=red,plotpoints=200]{0}{360}{sin(t)}{sin(2*t)}
196 \end{psgraph*}
197 %\psset{plotpoints=200}
198 %\pspicture(-2,-1.5)(2,1.5)
199 %\psset{xunit=1.7cm}
200 %\parametricPlot[linecolor=red,plotpoints=200]{0}{360}{sin(t)}{sin(2*t)}
201 %\psline{<->}(0,-1.2)(0,1.2)
202 %\psline{<->}(-1.2,0)(1.2,0)
203 %\endpspicture
204 \\ \hline
205 \BSS{parametricPlot}[linecolor=red,plotpoints=200]\AC{0}\AC{360}\AC{sin(t)}\AC{sin(2*t)} \\ \hline
206 \end{tabular}
207 \end{center}
208
209 %\newpage
210 \subsection{Option algebraic}
211 %\begin{itemize}
212 %\item Cette option permet de s'affranchir des équations en langage PostScript
213 %\item L'unité de x ou de t est le\emph{ radian }
214 %\end{itemize}
215 %
216 %
217 %
218 %\bigskip
219 %%
220 %\BS{}psplot[algebraic,plotpoints=200]\AC{0}\AC{12.56}\AC{ sin(x)}
221 %\smallskip
222
223 \begin{center}
224 \begin{tabular}{|c|} \hline
225 \begin{psgraph*}[,xticksize= -1.5 1.5 ,yticksize=13 , subticks=0, dx=1,Dx=1, dy=.5,Dy=.5](0,0)(0,-1.5)(13,1.5){10cm}{3cm }
226 \psplot[algebraic,plotpoints=200,linecolor=red]{0}{12.56}{ sin(x)}
227 \end{psgraph*}
228 %\pspicture(0,-1.1)(8,1.1)
229 %\psset{xunit=.5cm}
230 %\psplot[algebraic,plotpoints=200,linecolor=red]{0}{12.56}{ sin(x)}
231 %\psline{->}(15,0)
232 %\endpspicture
233 \\ \hline
234 \BS{}psplot[\RDD{algebraic},plotpoints=200]\AC{0}\AC{12.56}\AC{{\red sin(x)}} \RDI{algebraic}{pst-plot} \\ \hline
235 \TFRGB{L'unité de x est le}{x unit in }\emph{ radian }
236 \\ \hline
237 \end{tabular}
238 \end{center}
239 \bigskip
240 %
241
242 \smallskip
243
244
245 \begin{center}
246 \begin{tabular}{|c|} \hline
247 \begin{psgraph*}[,xticksize= -1.5 1.5 ,yticksize=-1.5 1.5 , subticks=0, dx=.5,Dx=.5, dy=.5,Dy=.5](0,0)(-1.5,-1.5)(1.5,1.5){5cm}{5cm }
248 \parametricplot[algebraic,plotpoints=200,linecolor=red]{0}{6.28}{sin(t)|sin(2*t)}
249 \end{psgraph*}
250 %\pspicture(-2,-1.5)(2,1.5)
251 %\psset{xunit=1.7cm}
252 %\parametricplot[algebraic,plotpoints=200,linecolor=red]{0}{6.28}{sin(t)|sin(2*t)}
253 %\psline{<->}(0,-1.2)(0,1.2)
254 %\psline{<->}(-1.2,0)(1.2,0)
255 %\endpspicture
256 \\ \hline
257 \BSS{parametricplot}[{\red algebraic},plotpoints=200]\AC{0}\AC{6.28}\AC{{\red sin(t)|sin(2*t)}}
258 \\ \hline
259 \TFRGB{L'unité de t est le}{t unit in }\emph{ radian }
260 \\ \hline
261 \end{tabular}
262 \end{center}
263
264 \subsection{Options VarStep et VarStepEpsilon }
265 \label{var}
266
267 \begin{tabular}{|c|} \hline
268 \begin{psgraph*}[,xticksize= -1.5 1.5 ,yticksize=13 , subticks=0, dx=1,Dx=1, dy=.5,Dy=.5](0,0)(0,-1.5)(13,1.5){10cm}{3cm }
269 \psplot[algebraic,VarStep=true,linecolor=red,showpoints=true,VarStepEpsilon=1]{0}{12.56}{ sin(x)}
270 \end{psgraph*}
271 \\ \hline
272 \BS{psplot}[algebraic,\RDD{VarStep}=true,showpoints=true,\RDD{VarStepEpsilon}=1]{0}\AC{12.56}\AC{ sin(x)} \RDI{VarStep}{pstricks-add} \RDI{VarStepEpsilon}{pstricks-add}
273 \\ \hline
274 \begin{psgraph*}[,xticksize= -1.5 1.5 ,yticksize=13 , subticks=0, dx=1,Dx=1, dy=.5,Dy=.5](0,0)(0,-1.5)(13,1.5){10cm}{3cm }
275 \psplot[algebraic,VarStep=true,linecolor=red,showpoints=true,VarStepEpsilon=.1]{0}{12.56}{ sin(x)}
276 \end{psgraph*}
277 \\ \hline
278 \BS{psplot}[algebraic,\RDD{VarStep}=true,showpoints=true,\RDD{VarStepEpsilon}=0.1]{0}\AC{12.56}\AC{ sin(x)}
279 \\ \hline
280 \begin{psgraph*}[,xticksize= -1.5 1.5 ,yticksize=13 , subticks=0, dx=1,Dx=1, dy=.5,Dy=.5](0,0)(0,-1.5)(13,1.5){10cm}{3cm }
281 \psplot[algebraic,VarStep=true,linecolor=red,showpoints=true,VarStepEpsilon=0.01]{0}{12.56}{ sin(x)}
282 \end{psgraph*}
283 \\ \hline
284 \BS{psplot}[algebraic,\RDD{VarStep}=true,showpoints=true,\RDD{VarStepEpsilon}=.001]{0}\AC{12.56}\AC{ sin(x)}
285 \\ \hline
286
287 \end{tabular}
288
289
290
291