<table cellspacing="0" cellpadding="0" border="0" ><tr><td valign="top" style="font: inherit;">Hi Herbert,<br><br>For me it would definitely useful. I tried to run your example but failed because my LaTeX installation (pdfeTeX) did not recognize<br><br>&nbsp;&nbsp;&nbsp; \tx@ScreenCoor<br><br>and<br><br>&nbsp;&nbsp;&nbsp; \tx@setlinejoin<br><br>Could it be a pdfTeX problem ?<br><br>Regards,<br>Martijn<br><br>--- On <b>Mon, 4/6/09, Herbert Voss <i>&lt;Herbert.Voss@FU-Berlin.DE&gt;</i></b> wrote:<br><blockquote style="border-left: 2px solid rgb(16, 16, 255); margin-left: 5px; padding-left: 5px;"><br>From: Herbert Voss &lt;Herbert.Voss@FU-Berlin.DE&gt;<br>Subject: [pstricks] tangent and orthogonal line<br>To: "Graphics with PSTricks" &lt;pstricks@tug.org&gt;<br>Date: Monday, April 6, 2009, 8:37 AM<br><br><div class="plainMail">Hi all,<br>I played a bit with tangent and orthogonal lines of a curve<br>given by several points and not a function. The
 following<br>example can draw a tangent or an othogonal line to a curve<br>defined by three points. Parameters are the coordinates of<br>the three points, the x value, and dx<br><br>If it may be useful, we can put it into one of the packages.<br><br>Herbert<br><br><br>\documentclass{minimal}<br>\usepackage{pst-3dplot}%&nbsp; for the linear equation system solver<br>\makeatletter<br>\def\psOrthLine{\pst@object{psOrthLine}}<br>\def\psOrthLine@i(#1,#2)(#3,#4)(#5,#6)#7#8{%<br>&nbsp; \begin@OpenObj%<br>&nbsp; \addto@pscode{<br>&nbsp; &nbsp; [[#1 dup dup mul exch 1 #2]<br>&nbsp; &nbsp;&nbsp;&nbsp;[#3 dup dup mul exch 1 #4]<br>&nbsp; &nbsp;&nbsp;&nbsp;[#5 dup dup mul exch 1 #6]]<br>&nbsp; &nbsp; tx@3DPlotDict begin SolveLinEqSystem end %<br>&nbsp; &nbsp; /abc ED&nbsp;&nbsp;&nbsp; &nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;% save the solution as array<br>&nbsp; &nbsp; abc aload pop&nbsp; &nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;% a b c on
 stack<br>&nbsp; &nbsp; exch #7&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;% a c b x<br>&nbsp; &nbsp; mul add exch&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;% c+b*x a<br>&nbsp; &nbsp; #7 dup mul mul add &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;% a*x^2+b*x+c<br>&nbsp; &nbsp; /y0 ED &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;% save value<br>&nbsp; &nbsp; abc aload pop pop exch % b a<br>&nbsp; &nbsp; #7 mul 2 mul add&nbsp; &nbsp; &nbsp;&nbsp;&nbsp;% b+2*a*x0<br>&nbsp; &nbsp; neg 1 exch div&nbsp; &nbsp; &nbsp; &nbsp;&nbsp;&nbsp;% mOrth<br>&nbsp; &nbsp; #8 mul /dy ED&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; % mOrth*dx<br>&nbsp; &nbsp; [<br>&nbsp; &nbsp; #7 #8 add y0 dy add \tx@ScreenCoor % x0+dx y0 +dy<br>&nbsp; &nbsp; #7 y0 \tx@ScreenCoor&nbsp;&nbsp;&nbsp;% x0 y0<br>&nbsp; &nbsp; /Lineto /lineto load def<br>&nbsp; &nbsp; \ifshowpoints true \else false \fi<br>&nbsp; &nbsp; \tx@setlinejoin &nbsp;&nbsp;&nbsp;
 &nbsp;&nbsp;&nbsp;% 0 1 or 2&nbsp;&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;&nbsp;&nbsp;%<br>&nbsp; &nbsp; \tx@Line }%&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; % load the pro function<br>&nbsp; \end@OpenObj\ignorespaces}<br>\def\psTangentLine{\pst@object{psTangentLine}}<br>\def\psTangentLine@i(#1,#2)(#3,#4)(#5,#6)#7#8{%<br>&nbsp; \begin@OpenObj%<br>&nbsp; \addto@pscode{<br>&nbsp; &nbsp; [[#1 dup dup mul exch 1 #2]<br>&nbsp; &nbsp;&nbsp;&nbsp;[#3 dup dup mul exch 1 #4]<br>&nbsp; &nbsp;&nbsp;&nbsp;[#5 dup dup mul exch 1 #6]]<br>&nbsp; &nbsp; tx@3DPlotDict begin SolveLinEqSystem end<br>&nbsp; &nbsp; /abc ED<br>&nbsp; &nbsp; abc aload pop&nbsp; &nbsp; % a b c on stack<br>&nbsp; &nbsp; exch #7&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; % a c b x<br>&nbsp; &nbsp; mul add exch&nbsp; &nbsp;&nbsp;&nbsp;% c+b*x a<br>&nbsp; &nbsp; #7 dup mul mul add /y0 ED<br>&nbsp; &nbsp; abc aload pop pop exch&nbsp; % b a<br>&nbsp; &nbsp; #7 mul 2 mul add&nbsp; &nbsp; &nbsp; &nbsp; %
 b+2*a*x0=mTan<br>&nbsp; &nbsp; dup&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;&nbsp;% mTan mTan<br>&nbsp; &nbsp; #8 mul /dy1 ED&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; % mTan*dx<br>&nbsp; &nbsp; #8 neg mul /dy2 ED&nbsp; &nbsp; &nbsp; % mTan*-dx<br>&nbsp; &nbsp; [<br>&nbsp; &nbsp; #7 #8 add y0 dy1 add \tx@ScreenCoor % x0+dx y0 +dy1<br>&nbsp; &nbsp; #7 #8 sub y0 dy2 add \tx@ScreenCoor % x0-dx y0 +dy2<br>&nbsp; &nbsp; /Lineto /lineto load def<br>&nbsp; &nbsp; \ifshowpoints true \else false \fi<br>&nbsp; &nbsp; \tx@setlinejoin &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;&nbsp;&nbsp;%<br>&nbsp; &nbsp; \tx@Line }%<br>&nbsp; \end@OpenObj\ignorespaces}<br>\makeatother<br>\begin{document}<br><br>\psset{unit=2}<br>\begin{pspicture}[showgrid=true](1,-1)(4,1)<br>&nbsp; \pscurve[showpoints=true](2.1,-0.2)(2.5,0.2)(3.2,0.235)(3.8,-0.2)<br>&nbsp;
 \psOrthLine[arrows=-&gt;,linecolor=red](2.5,0.2)(3.2,0.235)(3.8,-0.2){3}{0.1}<br><br>\psTangentLine[arrows=&lt;-&gt;,linecolor=blue](2.5,0.2)(3.2,0.235)(3.8,-0.2){3}{0.5}<br>\end{pspicture}<br><br>\end{document}<br>_______________________________________________<br>PSTricks mailing list<br><a ymailto="mailto:PSTricks@tug.org" href="/mc/compose?to=PSTricks@tug.org">PSTricks@tug.org</a><br><a href="http://tug.org/mailman/listinfo/pstricks" target="_blank">http://tug.org/mailman/listinfo/pstricks</a><br></div></blockquote></td></tr></table><br>