[pstricks] [PostScript] repeat-loop
Goebel, Juergen, OPE26
juergen.goebel at eads.com
Tue Oct 12 08:49:48 CEST 2004
Hi,
it's me again with a new question regarding PS-programming.
I'm trying to create a simple repeat-loop using the following
code-fragment:
\documentclass{scrartcl}
\usepackage{pstricks}
\usepackage{pst-plot}
\begin{document}
\psset{unit=1mm}
\begin{pspicture}(90,30)
\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
}
\psplot{-45}{45}{%
/n 0 def
5
{ n 1 add % <-----------------------
x kx mul n mul cos
n dc mul si
mul
add
} repeat
dc mul 2 mul
dc add
ky mul
}
\end{pspicture}
\end{document}
The marked line provokes my problem: What do I have
to do to define a loop-index (here: n) that I want to employ
in the body of the loop?
Regards,
Jürgen
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://tug.org/pipermail/pstricks/attachments/20041012/628d201d/attachment.html
More information about the PSTricks
mailing list