[pstricks] more on computed coordinates

Michael Sharpe msharpe at ucsd.edu
Sat Aug 9 00:50:21 CEST 2008


It looks to me that your expression for \thit may be incorrect, as it  
tries to take the square root of a negative number. (Try setting the  
\multido repetitions to 1 and insert \rput(2,-2){\yhit{\rx}{\ry}} to  
see the Postscript expression on the picture.)

Michael


On Aug 8, 2008, at 11:40 AM, Zbigniew Nitecki wrote:

> Thanks, Juergen and Michael.  I don't know what was going on, but  
> somehow things seemed to work in the end.  But now trying a more  
> complicated but analogous version of this, I run into trouble.  I  
> now want to draw arrows from the plane tangent at (0,1,1) to  
> z=x^2+y^2, which has the
> equation z=2y-1, to the graph.  Here is my code, including some  
> function definitions (I will comment on the comments (:-) below):
> *********************************************
> 	\begin{pspicture}(-2.5,-3)(2.5,3.5)
> 		\psset{Alpha=30}
> %		\psset{xunit=2cm, yunit=2cm}
> 		\pstThreeDCoor[xMax=2,yMax=2,zMax=3]
>
> 		\psplotThreeD[linecolor=gray,  
> drawStyle=xyLines,xPlotpoints=50,yPlotpoints=50]%
> 			(-1.5,1.5)(0,1.5){x 2 exp y 2 exp add}
> 		
> 		\newcommand{\zgraph}[2]{#1\space dup mul #2\space dup mul add}
> 		\newcommand{\zplane}[2]{#2\space 2 mul 1 sub}	
> 		\newcommand{\thit}[2]%
> 			{#2\space 2.5 #2\space mul 0.0625 add %
> 			#1\space dup mul sub 1 sub 0.5 exp sub %
> 			0.5 mul 0.125 add}
> 		\newcommand{\yhit}[2]{#2\space \thit{#1}{#2}\space 2 mul sub}
> 		\newcommand{\zhit}[2]{\zgraph{#1}{\yhit{#1}{#2}}}
> 		
> 		\multido{\rx=-0.9+0.4}{6}{%
> 			\multido{\ry=0.1+0.5}{3}{%
> %				\pstThreeDDot(\rx\space,\ry\space,\zplane{\rs}{\ry})
> %				\pstThreeDDot(\rx\space,\yhit{\rx}{\ry},\zhit{\rx}{\ry})
>




More information about the PSTricks mailing list