summaryrefslogtreecommitdiff
path: root/info/examples/PSTricks_en/15-05-5.ltx
diff options
context:
space:
mode:
Diffstat (limited to 'info/examples/PSTricks_en/15-05-5.ltx')
-rw-r--r--info/examples/PSTricks_en/15-05-5.ltx64
1 files changed, 64 insertions, 0 deletions
diff --git a/info/examples/PSTricks_en/15-05-5.ltx b/info/examples/PSTricks_en/15-05-5.ltx
new file mode 100644
index 0000000000..a5273c4bf7
--- /dev/null
+++ b/info/examples/PSTricks_en/15-05-5.ltx
@@ -0,0 +1,64 @@
+%%
+%% A DANTE-Edition example
+%%
+%%
+%% Copyright (C) 2010 Herbert Voss
+%%
+%% It may be distributed and/or modified under the conditions
+%% of the LaTeX Project Public License, either version 1.3
+%% of this license or (at your option) any later version.
+%%
+%% See http://www.latex-project.org/lppl.txt for details.
+%%
+%%
+%% ====
+% Show page(s) 1
+%%
+\documentclass[]{article}
+\pagestyle{empty}
+\setlength\textwidth{201.70511pt}
+\setlength\parindent{0pt}
+
+\usepackage{pstricks,pst-plot,pst-xkey,multido}
+\makeatletter
+\pst@addfams{user}
+\define@key[psset]{user}{nLoop}{\def\psnLoop{#1}}
+\psset[user]{nLoop=1}
+\makeatother
+\def\chooseColor#1{%
+ \ifcase#1\or red\or green\or blue\or cyan\or magenta\or gray\fi}
+
+\begin{document}
+\psset{xunit=1.5mm,yunit=3mm}
+\begin{pspicture}(-45,0)(45,20)
+ \psaxes[Dy=10,Dx=15]{->}(0,0)(-45,0)(45,20)%
+ \psset{linewidth=1pt}%
+ \pstVerb{%
+ /dc 0.2 def
+ /kx 12 def
+ /ky 12 def
+ /pi 3.141529 def
+ /rad2deg { 57.296 mul } def
+ /si { pi mul dup rad2deg sin exch div } def
+ /Func {
+ /nLoop exch def
+ x kx mul nLoop mul cos
+ nLoop dc mul si mul
+ } def
+ }%
+ \psset{plotpoints=400,linecolor=red,plotstyle=curve}%
+ \multido{\iA=1+1}{6}{%
+ \psplot[linecolor=\chooseColor\iA,nLoop=\iA]{-45}{45}{%
+ /y0 x kx mul cos dc si mul def
+ /y1 0 def
+ 1 1 \psnLoop {
+ Func y1 add /y1 exch def
+ } for
+ y1 y0 add
+ dc mul 2 mul
+ dc add
+ ky mul
+ }%
+ }%
+\end{pspicture}
+\end{document}