<!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 \rx\space cos 2.5 mul 4 sub def} %<br>
<br>
</font><font face="Myriad Pro">Note: /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. 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
<div>equation z=2y-1, to the graph. 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=->]%</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=->](0.8,1,1)(0.8,0.62,1.18)</div>
<div>%<span class="Apple-tab-span" style="white-space: pre;"> </span>\pstThreeDLine[arrows=->](1,1.5,2)(1,1.1,2.2)</div>
<div>%<span class="Apple-tab-span" style="white-space: pre;"> </span>\pstThreeDLine[arrows=->](1,1.3,1.6)(1,0.9,1.8)</div>
<div>%<span class="Apple-tab-span" style="white-space: pre;"> </span>\pstThreeDLine[arrows=->](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> -0.9 0.1 0.1 -1.4975 0.5</div>
<div>Execution stack:</div>
<div> %interp_exit .runexec2 --nostringval-- --nostringval--
--nostringval-- 2 %stopped_push --nostringval--
--nostringval-- --nostringval-- false 1 %stopped_push 1813
1 3 %oparray_pop 1812 1 3 %oparray_pop 1808 1 3
%oparray_pop 1691 1 3 %oparray_pop --nostringval--
%errorexec_pop .runexec2 --nostringval-- --nostringval--
--nostringval-- 2 %stopped_push --nostringval-- --nostringval--
--nostringval--</div>
<div>Dictionary stack:</div>
<div> --<a moz-do-not-send="true"
href="dict:1084/1123%28ro%29%28G%29--">dict:1084/1123(ro)(G)--</a> --<a
moz-do-not-send="true" href="dict:0/20%28G%29--">dict:0/20(G)--</a>
--<a moz-do-not-send="true" href="dict:113/200%28L%29--">dict:113/200(L)--</a>
--<a moz-do-not-send="true" href="dict:179/300%28L%29--">dict:179/300(L)--</a>
--<a moz-do-not-send="true" href="dict:102/200%28L%29--">dict:102/200(L)--</a>
--<a moz-do-not-send="true" href="dict:56/400%28L%29--">dict:56/400(L)--</a>
--<a moz-do-not-send="true" href="dict:0/10%28L%29--">dict:0/10(L)--</a>
--<a moz-do-not-send="true" href="dict:102/200%28L%29--">dict:102/200(L)--</a>
--<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. This didn't help. 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.
But the dot placement commands tell me that the problem is with
computing the coordinates from parameters \rx and \ry. </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"> <span class="Apple-converted-space"> </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"> <span class="Apple-converted-space"> </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"> <span class="Apple-converted-space"> </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ü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>