# [pstricks] \multido

Juergen Gilg gilg at acrotex.net
Mon Apr 12 18:58:10 CEST 2010

Dear list,

in the following example is some \multido - code to calculate some
intersection points of circles.

However when increasing the number of repeating the multido-loop, i get
a PS error.

The following example works -- however when increasing the loop number
from 5 to 6 (or bigger), some PS errors come along.
There are four intersection points missing in my example file -- for
sure i can calculate them by hand and insert them, but i am interested
in what is going wrong with my calculation  code. Must be something with
negative expressions within the square root.

Here the code:

%%%%%%%%%%%%%%%%%%
\documentclass{article}
\begin{document}
\begin{center}
\begin{pspicture*}(-1,-4)(4,4)
\multido{\rA=1+0.5}{8}{
\psarc[linewidth=0.5pt,linecolor=lightgray](0,1){\rA}{-90}{90}
\psarc[linewidth=0.5pt,linecolor=lightgray](0,-1){\rA}{-90}{90}
}
\multido{\rA=1+0.5}{5}{
\multido{\rB=1+0.5}{5}{
%\pscircle*(!\rA\space 2 exp 1 sub sqrt 0){0.05}
\pscircle*(!\rA\space 2 exp \rB\space 2 exp sub 4 add 4 div \rA\space
div 2 exp neg 1 add sqrt \rA\space mul  \rA\space 2 exp \rB\space 2 exp
sub 4 add 4 div 1 sub){0.05}
}}
\psframe[fillstyle=solid,fillcolor=white,linecolor=white](-0.2,6)(0.5,-6)
\pspolygon[fillstyle=solid,fillcolor=white,linecolor=white](3,6)(3,-6)(6,-6)(6,6)(3,6)
\pspolygon[fillstyle=solid,fillcolor=white,linecolor=white](0,0)(0,-6)(3,-6)(3,-3)(0,0)
\pspolygon[fillstyle=solid,fillcolor=white,linecolor=white](0,0)(0,6)(3,6)(3,3)(0,0)
\psdot(0,1)
\psdot(0,-1)
\psline[linewidth=2pt](3,-3)(3,3)
%\psgrid
\end{pspicture*}
\end{center}
\end{document}
%%%%%%%%%%%%%%%%%%%%%

Any explanations and help appreciated.
Anyone an idea?

Regards,

Juergen

--
Jürgen Gilg
Austr. 59
70376 Stuttgart
-------------------------------------
Tel       0711.59 27 88
e-Mail    gilg at acrotex.net

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://tug.org/pipermail/pstricks/attachments/20100412/47d48f76/attachment-0001.html>