7

I want to draw the tangent line as well as the normal line for an arbitrary curve as follows.

\documentclass[pstricks,border=12pt]{standalone}
\usepackage{pstricks-add}

\begin{document}
\begin{pspicture}[showgrid](6,3)
    \pscurve[curvature=1 1 1](0,0)(1,2)(2,1)(4,2)(6,1)
    \psTangentLine[Tnormal,linecolor=blue](2,1)(4,2)(6,1){3}{0.25}
    \psTangentLine[linecolor=red](2,1)(4,2)(6,1){3}{1}
    \pscircle*[linecolor=green](OCurve){3pt}
\end{pspicture}
\end{document}

enter image description here

Unfortunately, the point through which the above lines pass is not on the curve. What is wrong? And how to solve it?

7
+25

The problem comes from the fact that you are drawing your tangent on another curve than the original one. The first is defined with 5 points and is not the one defined with 3.

enter image description here

\documentclass[pstricks,border=12pt]{standalone}
\usepackage{pstricks-add}

\begin{document}
\begin{pspicture}[showgrid](6,3)
    \pscurve[curvature=1 1 1,linecolor=yellow](0,0)(1,2)(2,1)(4,2)(6,1)
    \pscurve[curvature=1 1 1](2,1)(4,2)(6,1)
    \psTangentLine[Tnormal,linecolor=blue](2,1)(4,2)(6,1){3}{0.25}
    \psTangentLine[linecolor=red](2,1)(4,2)(6,1){3}{1}
    \pscircle*[linecolor=green](OCurve){3pt}
\end{pspicture}
\end{document}
  • While your observation is correct, it doesn't show how to draw the correct tangents. – Christoph May 27 '14 at 17:17
  • Sorry but don't use pstricks for 4 years, and I don't know all this knew commands. I just tried somehing that came out in my memory. Could \psTangentLine syntax support 5 points difined curve ? If yes you have the solution, otherwise ... – Tarass May 27 '14 at 17:28
  • As one can see on page 41 in the pstricks add manual, math.sut.ac.th/lab/software/texlive/texmf-dist/doc/generic/…, one has to immitate the curve with 3 points, otherwise one has to give the mathematical equation of the curve. – Tarass May 28 '14 at 7:22

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.