[pstricks] multido

Michael Sharpe msharpe at ucsd.edu
Sat Nov 22 20:46:05 CET 2008


You can clip in each ThreeD plane to get something that may work. You  
have to be very careful to not introduce glue which can mess up the  
spacing----that's why all the % within the \multido.

Michael

\documentclass[dvips]{article}
\usepackage{pst-3dplot}
\usepackage{pst-all}
\usepackage{fp}
\begin{document}
\psset{unit=1in}
\begin{pspicture}(-1.5,-1.5)(1.5,1.5)
\pstThreeDCoor[xMin=-2,xMax=2,yMin=-2,yMax=2,zMin=-2,zMax=2]
\multido{\nA=-1+.1}{21}{%
\FPmul\nAsq\nA\nA% x^2
\FPsub\nF{1}\nAsq% 1-x^2
\FProot\nG\nF{2}%sqrt(1-x^2)
%slices with x fixed
\begin{psclip}{\pstThreeDLine[linestyle=none](\nA,-\nG,-1)(\nA,\nG,-1) 
(\nA,\nG,1)(\nA,-\nG,1)(\nA,-\nG,-1)}%
\parametricplotThreeD[linecolor=red](-1,1){\nA\space t \nAsq\space t t  
mul sub}%
\end{psclip}%
%slices with y fixed---interchange x, y
\begin{psclip}{\pstThreeDLine[linestyle=none](-\nG,\nA,-1)(\nG,\nA,-1) 
(\nG,\nA,1)(-\nG,\nA,1)(-\nG,\nA,-1)}%
\parametricplotThreeD[linecolor=blue](-1,1){t \nA\space t t mul  \nAsq 
\space sub}%
\end{psclip}%
}
\end{pspicture}
\end{document}



On Nov 21, 2008, at 12:09 PM, Zbigniew Nitecki wrote:

> 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?
>



More information about the PSTricks mailing list