I'm drawing smooth paths by using the
\draw plot[smooth, tension=.7] coordinates ...
command. Now I would like to draw tangents at the specified coordinates. I alreade tried Jake's answer, but I cannot figure out how to define the tangent points at certain coordinates instead of path positions like 0.4
.
My current code is the following:
\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{decorations.markings}
\begin{document}
\begin{tikzpicture}[scale=0.35, transform shape,
tangent/.style={
decoration={
markings,% switch on markings
mark=
at position #1
with
{
\coordinate (tangent point-\pgfkeysvalueof{/pgf/decoration/mark info/sequence number}) at (0pt,0pt);
\coordinate (tangent unit vector-\pgfkeysvalueof{/pgf/decoration/mark info/sequence number}) at (1,0pt);
\coordinate (tangent orthogonal unit vector-\pgfkeysvalueof{/pgf/decoration/mark info/sequence number}) at (0pt,1);
}
},
postaction=decorate
},
use tangent/.style={
shift=(tangent point-#1),
x=(tangent unit vector-#1),
y=(tangent orthogonal unit vector-#1)
},
use tangent/.default=1
]
\begin{scope}[every node/.style={fill,draw,blue!50,thick,circle}]
\draw[thick, tangent=0.9] plot[smooth, tension=.7] coordinates {(-8,5) (-5.5,7) (-3,5.5)};
\node (m1) at (-8,5) {};
\node (m2) at (-5.5,7) {};
\node (m3) at (-3,5.5) {};
\draw [blue, use tangent] (-0.5,0) -- (0.5,0);
\end{scope}
\begin{scope}[every node/.style={fill,draw,red!50,thick,circle}, rotate=8, shift={(-0.5,3.5)}]
\draw[thick] plot[smooth, tension=.7] coordinates {(-8,5) (-5.5,7) (-3,5.5)};
\node at (-8,5) {} edge (m1);
\node at (-5.5,7) {} edge (m2);
\node at (-3,5.5) {} edge (m2);
\end{scope}
\end{tikzpicture}
\end{document}
Which leads to:
I would like to draw tangent lines at the blue nodes and then replace the three direct connection lines by lines which start at the red nodes and finish orthogonally at the tangent lines:
Thanks in advance!
-|
systax together with Jake's answer, but unfortunately it didn't work. It could however be a starting point.