[pstricks] more on computed coordinates

Herbert Voss Herbert.Voss at FU-Berlin.DE
Sat Aug 9 12:03:20 CEST 2008

Zbigniew Nitecki schrieb:
> 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):

it is a bit diffucult to understand the differenve between TeX code
and PostScript code.

- after a TeX variable #? there is no need for a \space command
- after a TeX macro it is!
- pst-3dplot - coordinates are passed to PostScript as is, the
   comma is the separator,
   the reason why (5 sqrt, 3 4 mul /x 3 def, x 3  mul) will work

I insert an abs (see %%%%).



\psset{xunit=2cm, yunit=2cm}
    (-1.5,1.5)(0,1.5){x 2 exp y 2 exp add}
\newcommand\zgraph[2]{ #1 dup mul #2 dup mul add }
\newcommand\zplane[2]{ #2 2 mul 1 sub }
   #2 2.5 #2 mul 0.0625 add #1 dup mul sub 1 sub abs %%%%%
   0.5 exp sub 0.5 mul 0.125 add }
\newcommand\yhit[2]{#2 \thit{#1}{#2}\space 2 mul sub }
\newcommand\zhit[2]{\zgraph{#1}\space \yhit{#1}{#2} }
     \pstThreeDLine[linestyle=dashed, arrows=->]%
   drawStyle=xyLines](-1,1)(0,2){y 2 mul 1 sub}


More information about the PSTricks mailing list