[pstricks] multido

Zbigniew Nitecki zbigniew.nitecki at tufts.edu
Fri Nov 21 21:09:24 CET 2008

As a solution to the baby problem, this is brilliant.  But is there a
way to clip a \pstThreeDPlot
or \parametricplotThreeD?
What I really want to do is to graph a function (in my case, (x^2-y^2)/
2 ) over a circle (but both the above-mentioned allow only graphs over
a rectangle;  if I translate into a polar form to get the circular
domain, then the lines go radially (or are circles) instead of being x-
lines and y-lines.
This is why I wanted to use the multido.

Perhaps I am unclear on the function of \function in Herbert's
example.  I thought that it is defined as the calculation [-2(xVal)+8]/
[2(xVal)-2].  So where it says
\pstVerb{/xVal \function\space def}, what is the function of \function?

Zbigniew Nitecki
Department of Mathematics
Tufts University
Medford, MA 02155

telephones:
Office    (617)627-3843
Dept.    (617)627-3234
Dept. fax    (617)627-3966
http://www.tufts.edu/~znitecki/

On Nov 21, 2008, at 14:08, Michael Sharpe wrote:

> In Herbert's code, xVal is incremented in PostScript code in the line
> pstVerb{ /xVal \function\space def}
>
> You might find it easier for your particular problem to use clipping,
> as in:
>
> \begin{pspicture}[showgrid=true](-1.5,-1.5)(1.5,1.5)
> \begin{psclip}{\pscircle{1}}
> \multido{\n=-1+.25}{9}{\psline(-1,\n)(1,\n)\psline(\n,-1)(\n,1)}
> \end{psclip}
> \end{pspicture}
>
> Michael
>
> On Nov 21, 2008, at 10:26 AM, Zbigniew Nitecki wrote:
>
>> The following is copied from one of Herbert's responses to someone
>> else:
>> ********************************************************************************
>> \documentclass{article}
>> \usepackage{amsmath}
>>
>> \begin{document}
>>
>> \begin{center}
>> \psset{xunit=2cm,yunit=2cm,algebraic=true}
>> \begin{pspicture}[showgrid=true](-5,-5)(1,1)
>> \psaxes{->}(0,0)(-5,-5)(1,1)[$x$,-90][$y$,180]%
>> \rput(-2,-3){{$y=\dfrac{-2x+8}{~~2x-2}$}}%
>> \psplot {-5}{0.10}{x }%
>> \psplot[linecolor=red,linewidth=1.5pt]{-5}{0.10}{(-2*x+8)/(2*x-2)}%
>> \def\function{ -2 xVal mul 8 add 2 xVal mul -2 add div }%
>> \pstVerb{ /xVal 0 def }% start value
>> \multido{\nA=0+1}{4}{%
>>   \psline[linecolor=blue,linewidth=1.5pt]{->}(! xVal xVal )(! xVal
>> \function )
>>   \psline[linecolor=blue,linewidth=1.5pt]{->}(! xVal \function )(!
>> \function\space dup)
>>   \pstVerb{ /xVal \function\space def}
>>   \psline[linestyle=dashed,linecolor=blue]{->}(! xVal xVal)(! xVal
>> 0 )
>>   \uput{1ex}[90](! xVal 0 ){$v_{\nA}$}
>> }
>> \end{pspicture}
>> \end{center}
>>
>> \end{document}
>> ********************************************************************************************
>> I am trying to use this as a model for plotting a function using a
>> rectangular grid, but over
>> a non-rectangular region.  My basic question can be formulated even
>> letting the function be
>> the zero constant:  so filling say the circle of radius 1 in the xy-
>> plane with lines parallel to the
>> coordinate axes, spaced 0.25 apart.  My model is as follows, but my
>> question is what goes in the places marked with ??: I can't
>> understand where in the example above the value of xVal is
>> incremented, or equivalently, the role of \nA.  Of course, if I am
>> making other sytactic errors,
>> ***********************************************************************************************
>> \def\function{1 tVal dup mul sub exp 0.5}
>> \pstVerb{tVal -0.75 def}
>> \multido{??=??}{6}{%
>> 	\psline(!\function \neg tVal)(!\function tVal)
>> 	\psline{!tVal \function \neg){!tVal \function)
>> }
>> ***************************************************************************************************
>>
> _______________________________________________
> PSTricks mailing list
> PSTricks at tug.org
> http://tug.org/mailman/listinfo/pstricks

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://tug.org/pipermail/pstricks/attachments/20081121/f918dc4e/attachment-0001.html