[pstricks] multido

Michael Sharpe msharpe at ucsd.edu
Tue Feb 17 17:20:39 CET 2009


On Feb 17, 2009, at 7:31 AM, Zbigniew Nitecki wrote:

> I am trying to plot the surface z=4x^2 +y^2 but only for values  
> z<=1;  I am trying to do this by
> plotting a "vertical slice" at y=\ry via a multido.  What's wrong  
> with this code?
>
> 	\begin{pspicture}(-5,-5)(5,2)
> 		\multido{\ry=-0.1+0.1}{19}{
> 			\parametricplotThreeD(!%
> 				0.5 1 \ry\space dup mul sub 0.5 exp mul neg,
> 				0.5 1 \ry\space dup mul sub 0.5 exp mul){%
> 					t %
> 					\ry %
> 					t dup mul 4 mul \ry\space dup mul add%
> 				}
> 		}
> 	\end{pspicture}
>
>

Try

	\begin{pspicture}(-5,-5)(5,2)
		\multido{\ry=-0.1+0.1}{11}{%<<<<<< 19->11, so you don't take square  
root of a negative num
			\parametricplotThreeD(% <<<< DROP !
				0.5 1 \ry\space dup mul sub 0.5 exp mul neg,
				0.5 1 \ry\space dup mul sub 0.5 exp mul){%
					t %
					\ry\space %<<<<<<<< ADD \space
					t dup mul 4 mul \ry\space dup mul add%
				}
		}
	\end{pspicture}


Michael


More information about the PSTricks mailing list