<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
  <meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
<font face="Myriad Pro">Dear Zbigniew,<br>
<br>
did you try_\pstVerb_ to define some fuctions in PostScript and then
use them within the coordinates?<br>
<br>
Here a little example:<br>
<br>
\pstVerb{/Xcoord&nbsp;&nbsp; \rx\space cos 2.5 mul 4 sub&nbsp; def} %<br>
<br>
</font><font face="Myriad Pro">Note:&nbsp; /Xcoor with a slash, not a
backslash.<br>
</font><font face="Myriad Pro"><br>
Here you define _Xcoord_. <br>
Now you can insert it in the coordinates: (Xcoord, bla, bla)<br>
<br>
Hope that helps,<br>
<br>
Juergen<br>
</font><br>
Zbigniew Nitecki wrote:
<blockquote cite="mid:AB1967D1-5F5A-48B2-B8C3-E90371BF6E3B@tufts.edu"
 type="cite">Thanks, Juergen and Michael. &nbsp;I don't know what was going
on, but somehow things seemed to work in the end. &nbsp;But now trying a
more complicated but analogous version of this, I run into trouble. &nbsp;I
now want to draw arrows from the plane tangent at (0,1,1) to z=x^2+y^2,
which has the
  <div>equation z=2y-1, to the graph. &nbsp;Here is my code, including some
function definitions (I will comment on the comments (:-) below):</div>
  <div>*********************************************</div>
  <div>
  <div><span class="Apple-tab-span" style="white-space: pre;"> </span>\begin{pspicture}(-2.5,-3)(2.5,3.5)</div>
  <div><span class="Apple-tab-span" style="white-space: pre;"> </span>\psset{Alpha=30}</div>
  <div>%<span class="Apple-tab-span" style="white-space: pre;"> </span>\psset{xunit=2cm,
yunit=2cm}</div>
  <div><span class="Apple-tab-span" style="white-space: pre;"> </span>\pstThreeDCoor[xMax=2,yMax=2,zMax=3]</div>
  <div><br>
  </div>
  <div><span class="Apple-tab-span" style="white-space: pre;"> </span>\psplotThreeD[linecolor=gray,
drawStyle=xyLines,xPlotpoints=50,yPlotpoints=50]%</div>
  <div><span class="Apple-tab-span" style="white-space: pre;"> </span>(-1.5,1.5)(0,1.5){x
2 exp y 2 exp add}</div>
  <div><span class="Apple-tab-span" style="white-space: pre;"> </span></div>
  <div><span class="Apple-tab-span" style="white-space: pre;"> </span>\newcommand{\zgraph}[2]{#1\space
dup mul #2\space dup mul add}</div>
  <div><span class="Apple-tab-span" style="white-space: pre;"> </span>\newcommand{\zplane}[2]{#2\space
2 mul 1 sub}<span class="Apple-tab-span" style="white-space: pre;"> </span></div>
  <div><span class="Apple-tab-span" style="white-space: pre;"> </span>\newcommand{\thit}[2]%</div>
  <div><span class="Apple-tab-span" style="white-space: pre;"> </span>{#2\space
2.5 #2\space mul 0.0625 add %</div>
  <div><span class="Apple-tab-span" style="white-space: pre;"> </span>#1\space
dup mul sub 1 sub 0.5 exp sub %</div>
  <div><span class="Apple-tab-span" style="white-space: pre;"> </span>0.5
mul 0.125 add}</div>
  <div><span class="Apple-tab-span" style="white-space: pre;"> </span>\newcommand{\yhit}[2]{#2\space
\thit{#1}{#2}\space 2 mul sub}</div>
  <div><span class="Apple-tab-span" style="white-space: pre;"> </span>\newcommand{\zhit}[2]{\zgraph{#1}{\yhit{#1}{#2}}}</div>
  <div><span class="Apple-tab-span" style="white-space: pre;"> </span></div>
  <div><span class="Apple-tab-span" style="white-space: pre;"> </span>\multido{\rx=-0.9+0.4}{6}{%</div>
  <div><span class="Apple-tab-span" style="white-space: pre;"> </span>\multido{\ry=0.1+0.5}{3}{%</div>
  <div>%<span class="Apple-tab-span" style="white-space: pre;"> </span>\pstThreeDDot(\rx\space,\ry\space,\zplane{\rs}{\ry})</div>
  <div>%<span class="Apple-tab-span" style="white-space: pre;"> </span>\pstThreeDDot(\rx\space,\yhit{\rx}{\ry},\zhit{\rx}{\ry})</div>
  <div>%<span class="Apple-tab-span" style="white-space: pre;"> </span>\pstThreeDLine[linestyle=dashed,
arrows=-&gt;]%</div>
  <div>%<span class="Apple-tab-span" style="white-space: pre;"> </span>(\rx\space,\ry\space,\zplane{\rs}{\ry})%</div>
  <div>%<span class="Apple-tab-span" style="white-space: pre;"> </span>(\rx\space,\yhit{\rx}{\ry},\zhit{\rx}{\ry})</div>
  <div><span class="Apple-tab-span" style="white-space: pre;"> </span>}</div>
  <div><span class="Apple-tab-span" style="white-space: pre;"> </span>}</div>
  <div>%<span class="Apple-tab-span" style="white-space: pre;"> </span>\pstThreeDDot(1,\yhit{1}{1},\zhit{1}{1})</div>
  <div><br>
  </div>
  <div>%<span class="Apple-tab-span" style="white-space: pre;"> </span>\pstThreeDLine[arrows=-&gt;](0.8,1,1)(0.8,0.62,1.18)</div>
  <div>%<span class="Apple-tab-span" style="white-space: pre;"> </span>\pstThreeDLine[arrows=-&gt;](1,1.5,2)(1,1.1,2.2)</div>
  <div>%<span class="Apple-tab-span" style="white-space: pre;"> </span>\pstThreeDLine[arrows=-&gt;](1,1.3,1.6)(1,0.9,1.8)</div>
  <div>%<span class="Apple-tab-span" style="white-space: pre;"> </span>\pstThreeDLine[arrows=-&gt;](1,1,1)(1,0.5,1.25)</div>
  <div><span class="Apple-tab-span" style="white-space: pre;"> </span></div>
  <div><span class="Apple-tab-span" style="white-space: pre;"> </span>\psplotThreeD[linecolor=lightgray,
drawStyle=xyLines](-1,1)(0,2){y 2 mul 1 sub}</div>
  <div><span class="Apple-tab-span" style="white-space: pre;"> </span></div>
  <div><span class="Apple-tab-span" style="white-space: pre;"> </span>\pstThreeDDot(0,1,1)</div>
  <div><span class="Apple-tab-span" style="white-space: pre;"> </span>\end{pspicture}</div>
  <div>****************************************************************************************************</div>
  <div>1. When the first line inside the multido is uncommented, it
works fine.</div>
  <div>2. When the second line inside the multido is uncommented, I get</div>
  <div>*************************************************************************</div>
  <div>
  <div>Error: /undefinedresult in --exp--</div>
  <div>Operand stack:</div>
  <div>&nbsp;&nbsp; -0.9 &nbsp; 0.1 &nbsp; 0.1 &nbsp; -1.4975 &nbsp; 0.5</div>
  <div>Execution stack:</div>
  <div>&nbsp;&nbsp; %interp_exit &nbsp; .runexec2 &nbsp; --nostringval-- &nbsp; --nostringval--
&nbsp; --nostringval-- &nbsp; 2 &nbsp; %stopped_push &nbsp; --nostringval-- &nbsp;
--nostringval-- &nbsp; --nostringval-- &nbsp; false &nbsp; 1 &nbsp; %stopped_push &nbsp; 1813 &nbsp;
1 &nbsp; 3 &nbsp; %oparray_pop &nbsp; 1812 &nbsp; 1 &nbsp; 3 &nbsp; %oparray_pop &nbsp; 1808 &nbsp; 1 &nbsp; 3 &nbsp;
%oparray_pop &nbsp; 1691 &nbsp; 1 &nbsp; 3 &nbsp; %oparray_pop &nbsp; --nostringval-- &nbsp;
%errorexec_pop &nbsp; .runexec2 &nbsp; --nostringval-- &nbsp; --nostringval-- &nbsp;
--nostringval-- &nbsp; 2 &nbsp; %stopped_push &nbsp; --nostringval-- &nbsp; --nostringval--
&nbsp; --nostringval--</div>
  <div>Dictionary stack:</div>
  <div>&nbsp;&nbsp; --<a moz-do-not-send="true"
 href="dict:1084/1123%28ro%29%28G%29--">dict:1084/1123(ro)(G)--</a> &nbsp; --<a
 moz-do-not-send="true" href="dict:0/20%28G%29--">dict:0/20(G)--</a> &nbsp;
--<a moz-do-not-send="true" href="dict:113/200%28L%29--">dict:113/200(L)--</a>
&nbsp; --<a moz-do-not-send="true" href="dict:179/300%28L%29--">dict:179/300(L)--</a>
&nbsp; --<a moz-do-not-send="true" href="dict:102/200%28L%29--">dict:102/200(L)--</a>
&nbsp; --<a moz-do-not-send="true" href="dict:56/400%28L%29--">dict:56/400(L)--</a>
&nbsp; --<a moz-do-not-send="true" href="dict:0/10%28L%29--">dict:0/10(L)--</a>
&nbsp; --<a moz-do-not-send="true" href="dict:102/200%28L%29--">dict:102/200(L)--</a>
&nbsp; --<a moz-do-not-send="true" href="dict:95/200%28L%29--">dict:95/200(L)--</a></div>
  <div>Current allocation mode is local</div>
  <div>Last OS error: 2</div>
  <div>Current file position is 187224</div>
  <div>GPL Ghostscript 8.57: Unrecoverable error, exit code 1</div>
  <div>### FAILED to generate
/tmp/altpdflatex.1535-1218220543/picturetest.pdf ()</div>
  <div>*************************************************************************************</div>
  <div>I had initially thought that trying to square \ry=-0.9 via 2 exp
could hang up because of the exp of a negative, so I replaced 2 exp
with dup mul. &nbsp;This didn't help. &nbsp;However, the function definitions do
seem to work: when I put in explicit numbers (eg, commented line
immediately following the multido) it works fine.</div>
  <div><br>
  </div>
  <div>I am of course not interested in placing these dots, but rather
want the arrows given by the third to fifth lines inside the multido.
&nbsp;But the dot placement commands tell me that the problem is with
computing the coordinates from parameters \rx and \ry. &nbsp;</div>
  <div><br>
  </div>
  <div>Any suggestions?</div>
  <div><br>
  </div>
  </div>
  </div>
  <div><br>
  <div apple-content-edited="true"><span class="Apple-style-span"
 style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">
  <p style="margin: 0px;"><font
 style="font-family: Helvetica; font-style: normal; font-variant: normal; font-weight: normal; font-size: 12px; line-height: normal; font-size-adjust: none; font-stretch: normal;"
 face="Helvetica" size="3">Zbigniew Nitecki</font></p>
  <p style="margin: 0px;"><font
 style="font-family: Helvetica; font-style: normal; font-variant: normal; font-weight: normal; font-size: 12px; line-height: normal; font-size-adjust: none; font-stretch: normal;"
 face="Helvetica" size="3">Department of Mathematics</font></p>
  <p style="margin: 0px;"><font
 style="font-family: Helvetica; font-style: normal; font-variant: normal; font-weight: normal; font-size: 12px; line-height: normal; font-size-adjust: none; font-stretch: normal;"
 face="Helvetica" size="3">Tufts University</font></p>
  <p style="margin: 0px;"><font
 style="font-family: Helvetica; font-style: normal; font-variant: normal; font-weight: normal; font-size: 12px; line-height: normal; font-size-adjust: none; font-stretch: normal;"
 face="Helvetica" size="3">Medford, MA 02155</font></p>
  <p
 style="margin: 0px; font-family: Helvetica; font-style: normal; font-variant: normal; font-weight: normal; font-size: 12px; line-height: normal; font-size-adjust: none; font-stretch: normal; min-height: 14px;"><br>
  </p>
  <p style="margin: 0px;"><font
 style="font-family: Helvetica; font-style: normal; font-variant: normal; font-weight: normal; font-size: 12px; line-height: normal; font-size-adjust: none; font-stretch: normal;"
 face="Helvetica" size="3">telephones:</font></p>
  <p style="margin: 0px;"><font
 style="font-family: Helvetica; font-style: normal; font-variant: normal; font-weight: normal; font-size: 12px; line-height: normal; font-size-adjust: none; font-stretch: normal;"
 face="Helvetica" size="3">Office<span class="Apple-converted-space"><span
 class="Apple-converted-tab">&nbsp; &nbsp;<span class="Apple-converted-space">&nbsp;</span></span></span>(617)627-3843</font></p>
  <p style="margin: 0px;"><font
 style="font-family: Helvetica; font-style: normal; font-variant: normal; font-weight: normal; font-size: 12px; line-height: normal; font-size-adjust: none; font-stretch: normal;"
 face="Helvetica" size="3">Dept.<span class="Apple-converted-space"><span
 class="Apple-converted-tab">&nbsp; &nbsp;<span class="Apple-converted-space">&nbsp;</span></span></span>(617)627-3234</font></p>
  <p style="margin: 0px;"><font
 style="font-family: Helvetica; font-style: normal; font-variant: normal; font-weight: normal; font-size: 12px; line-height: normal; font-size-adjust: none; font-stretch: normal;"
 face="Helvetica" size="3">Dept. fax<span class="Apple-converted-space"><span
 class="Apple-converted-tab">&nbsp; &nbsp;<span class="Apple-converted-space">&nbsp;</span></span></span>(617)627-3966</font></p>
  <a moz-do-not-send="true" href="http://www.tufts.edu/%7Eznitecki/">http://www.tufts.edu/~znitecki/</a></span>
  </div>
  <br>
  </div>
  <pre wrap="">
<hr size="4" width="90%">
_______________________________________________
PSTricks mailing list
<a class="moz-txt-link-abbreviated" href="mailto:PSTricks@tug.org">PSTricks@tug.org</a>
<a class="moz-txt-link-freetext" href="http://tug.org/mailman/listinfo/pstricks">http://tug.org/mailman/listinfo/pstricks</a>
  </pre>
</blockquote>
<br>
<pre class="moz-signature" cols="65">-- 
 J&uuml;rgen Gilg
 Austr. 59
 70376 Stuttgart
-------------------------------------
 Tel       0711.59 27 88
 e-Mail    <a class="moz-txt-link-abbreviated" href="mailto:gilg@acrotex.net">gilg@acrotex.net</a>
 Websites  <a class="moz-txt-link-abbreviated" href="http://www.acrotex.net">www.acrotex.net</a>
           <a class="moz-txt-link-abbreviated" href="http://www.brueckenkurs-physik.de">www.brueckenkurs-physik.de</a>
           <a class="moz-txt-link-abbreviated" href="http://www.gilligan-online.de">www.gilligan-online.de</a>
</pre>
</body>
</html>