This questions is based on Jake's answer given here, and the sample code is modified from there.
I am using the markings library to get obtain a tangent coordinate system, but would like to combine this with the |- command in the coordinate specification. For a MWE, consider this:
\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{decorations.markings}
\begin{document}
\begin{tikzpicture}[
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
]
\draw [
tangent=0.4,
tangent=0.56
] (0,0)
to [out=20,in=120] (5,2)
to [out=-60, in=110] (9,1);
\path (6,4) coordinate (x);
\draw [orange, thick, use tangent=2] (-2,0) -- (2,0) (0,0 -| x) -- (x);
\end{tikzpicture}
\end{document}
The original code had
\draw [orange, thick, use tangent=2] (-2,0) -- (2,0) (0,0) -- (0,1);
instead of
\draw [orange, thick, use tangent=2] (-2,0) -- (2,0) (0,0 -| x) -- (x);
and obtained a nice orange tangent coordinate system. In my case, I want the orthogonal line not be centered at (0,0) but somewhere off to the side so that it ends at the (named) node x. Is there a way to adapt the |- so that it, too, uses the tangent coordinate system rather than the original one?
In pictures, my current code produces a line that is vertical in the original coordinate system:
What I would like to see is a line that is vertical in the tangent coordinate system:


