Hello <BR>For me it worws perfectly(on miktex2.7), may be you have to delete the spaces between line (if you have copy/paste from the mail of Herbert)<BR>Thanks Herbert <BR><BR><BR><BR><BR>
<BLOCKQUOTE style="BORDER-LEFT: #ff0000 2px solid; PADDING-LEFT: 5px; MARGIN-LEFT: 5px">> Message du 06/04/09 à 08h54<BR>> De : "Herbert Voss" <HERBERT.VOSS@FU-BERLIN.DE><BR>> A : "Graphics with PSTricks" <PSTRICKS@TUG.ORG><BR>> Copie à : <BR>> Objet : [pstricks] tangent and orthogonal line<BR>> <BR>> <BR>> 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}% 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>> \begin@OpenObj%<BR>> \addto@pscode{<BR>> [[#1 dup dup mul exch 1 #2]<BR>> [#3 dup dup mul exch 1 #4]<BR>> [#5 dup dup mul exch 1 #6]]<BR>> tx@3DPlotDict begin SolveLinEqSystem end %<BR>> /abc ED % save the solution as array<BR>> abc aload pop % a b c on stack<BR>> exch #7 % a c b x<BR>> mul add exch % c+b*x a<BR>> #7 dup mul mul add % a*x^2+b*x+c<BR>> /y0 ED % save value<BR>> abc aload pop pop exch % b a<BR>> #7 mul 2 mul add % b+2*a*x0<BR>> neg 1 exch div % mOrth<BR>> #8 mul /dy ED % mOrth*dx<BR>> [<BR>> #7 #8 add y0 dy add \tx@ScreenCoor % x0+dx y0 +dy<BR>> #7 y0 \tx@ScreenCoor % x0 y0<BR>> /Lineto /lineto load def<BR>> \ifshowpoints true \else false \fi<BR>> \tx@setlinejoin % 0 1 or 2 %<BR>> \tx@Line }% % load the pro function<BR>> \end@OpenObj\ignorespaces}<BR>> \def\psTangentLine{\pst@object{psTangentLine}}<BR>> \def\psTangentLine@i(#1,#2)(#3,#4)(#5,#6)#7#8{%<BR>> \begin@OpenObj%<BR>> \addto@pscode{<BR>> [[#1 dup dup mul exch 1 #2]<BR>> [#3 dup dup mul exch 1 #4]<BR>> [#5 dup dup mul exch 1 #6]]<BR>> tx@3DPlotDict begin SolveLinEqSystem end<BR>> /abc ED<BR>> abc aload pop % a b c on stack<BR>> exch #7 % a c b x<BR>> mul add exch % c+b*x a<BR>> #7 dup mul mul add /y0 ED<BR>> abc aload pop pop exch % b a<BR>> #7 mul 2 mul add % b+2*a*x0=mTan<BR>> dup % mTan mTan<BR>> #8 mul /dy1 ED % mTan*dx<BR>> #8 neg mul /dy2 ED % mTan*-dx<BR>> [<BR>> #7 #8 add y0 dy1 add \tx@ScreenCoor % x0+dx y0 +dy1<BR>> #7 #8 sub y0 dy2 add \tx@ScreenCoor % x0-dx y0 +dy2<BR>> /Lineto /lineto load def<BR>> \ifshowpoints true \else false \fi<BR>> \tx@setlinejoin %<BR>> \tx@Line }%<BR>> \end@OpenObj\ignorespaces}<BR>> \makeatother<BR>> \begin{document}<BR>> <BR>> \psset{unit=2}<BR>> \begin{pspicture}[showgrid=true](1,-1)(4,1)<BR>> \pscurve[showpoints=true](2.1,-0.2)(2.5,0.2)(3.2,0.235)(3.8,-0.2)<BR>> \psOrthLine[arrows=->,linecolor=red](2.5,0.2)(3.2,0.235)(3.8,-0.2){3}{0.1}<BR>> <BR>> \psTangentLine[arrows=<->,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>> PSTricks@tug.org<BR>> http://tug.org/mailman/listinfo/pstricks<BR>> <BR>> </BLOCKQUOTE>
<P><BR><BR></P>Cordialement<BR>Azzam HASSAN<BR>tel : 06 63 82 97 09<BR><br>
<br><hr>Avez-vous vu le nouveau <A href="http://r.voila.fr/r?ref=signature_mail_voila_voilanouveau_1&url=http://www.voila.fr">Voila</A> !</DIV>