This is a possible way. If you do not want to load pgfplots, I am afraid it will be considerably more effort.
How does this proposal work?
- The
pgplots
(!) library fillbetween
allows us to decompose paths into intersection segments. These are called A1
and A2
in the examples below, and can be reversed, if needed.
- Once we have such an intersection segment, the problem boils down to attaching tangents at the ends of these segments, which is a long-solved problem, see this answer.
These codes illustrate this.
\documentclass[tikz]{standalone}
\usepackage{pgfplots}
\usepgfplotslibrary{fillbetween}
\usetikzlibrary{decorations.markings}
\begin{document}
\begin{tikzpicture}[tangent at/.style={% cf. https://tex.stackexchange.com/questions/25928/how-to-draw-tangent-line-of-an-arbitrary-point-on-a-path-in-tikz/25940#25940
decoration={ markings,
mark =at position #1 with {\draw[purple,-latex](0,0) -- (0.5,0);},
}, decorate
}]
\draw (0, 0.2) .. controls ++(0.5,0.75) and ++(-0.5,-0.75) .. (1,0.2) coordinate (LP1);
\draw [xshift=1cm, blue, name path=eta]
(0, 0.3) .. controls ++(0.5,0.75) and ++(-0.5,0) .. (1.0,-0.4)
.. controls ++(0.3,0) and ++(-0.3,0) .. (1.6, 0.3) coordinate (LP2);
\draw [gray, name path=eta0] (LP1) -- (LP1-|LP2);
\draw [red, name intersections={of=eta and eta0,total=\t}]
\foreach \s in {1,...,\t}{ (intersection-\s) circle (1pt) };
\path [%draw,blue,
name path=middle arc,
intersection segments={
of=eta and eta0,
sequence={A1}
},
postaction={tangent at/.list={0,1}}];
\end{tikzpicture}
\end{document}

You can do that with more intersections, too. You only need to add the tangents at the appropriate intersection segments.
\documentclass[tikz]{standalone}
\usepackage{pgfplots}
\usepgfplotslibrary{fillbetween}
\usetikzlibrary{decorations.markings}
\begin{document}
\begin{tikzpicture}[tangent at/.style={% cf. https://tex.stackexchange.com/questions/25928/how-to-draw-tangent-line-of-an-arbitrary-point-on-a-path-in-tikz/25940#25940
decoration={ markings,
mark =at position #1 with {\draw[purple,-latex](0,0) -- (0.5,0);},
}, decorate
}]
\draw (0, 0.2) .. controls ++(0.5,0.75) and ++(-0.5,-0.75) .. (1,0.2)
coordinate (LP1);
\draw [xshift=1cm, blue, name path=eta]
(0, 0.3) .. controls ++(0.5,0.75) and ++(-0.5,0) .. (1.0,-0.4)
.. controls ++(0.3,0) and ++(-0.3,0) .. (1.6, 0.3)
.. controls ++(0.6,0) and ++(-0.6,0) .. (2.8,-0.3) coordinate (LP2);
\draw [gray, name path=eta0] (LP1) -- (LP1-|LP2);
\draw [red, name intersections={of=eta and eta0,total=\t}]
\foreach \s in {1,...,\t}{ (intersection-\s) circle (1pt) };
\path [%draw,red,thick,
intersection segments={
of=eta and eta0,
sequence={A1}
},
postaction={tangent at/.list={0,1}}];
\path [%draw,green,thick,
intersection segments={
of=eta and eta0,
sequence={A2}
},
postaction={tangent at/.list={1}}];
\end{tikzpicture}
\end{document}

Of course, this can be automatized.
\documentclass[tikz]{standalone}
\usepackage{pgfplots}
\usepgfplotslibrary{fillbetween}
\usetikzlibrary{decorations.markings}
\begin{document}
\begin{tikzpicture}[tangent at/.style={% cf. https://tex.stackexchange.com/questions/25928/how-to-draw-tangent-line-of-an-arbitrary-point-on-a-path-in-tikz/25940#25940
decoration={ markings,
mark =at position #1 with {\draw[purple,-latex](0,0) -- (0.5,0);},
}, decorate
}]
\draw (0, 0.2) .. controls ++(0.5,0.75) and ++(-0.5,-0.75) .. (1,0.2)
coordinate (LP1);
\draw [xshift=1cm, blue, name path=eta]
(0, 0.3) .. controls ++(0.5,0.75) and ++(-0.5,0) .. (1.0,-0.4)
.. controls ++(0.3,0) and ++(-0.3,0) .. (1.6, 0.3)
.. controls ++(0.6,0) and ++(-0.6,0) .. (2.8,-0.3) coordinate (LP2);
\draw [gray, name path=eta0] (LP1) -- (LP1-|LP2);
\draw [red, name intersections={of=eta and eta0,total=\t},
/utils/exec={\xdef\NumIntersection{\t}}]
\foreach \s in {1,...,\t}{
(intersection-\s) circle (1pt) };
\foreach \X [count=\Y starting from 0] in {1,...,\NumIntersection}
{
\path [%draw,red,thick,
intersection segments={
of=eta and eta0,
sequence={A\Y}
},
postaction={tangent at=1}];
}
\end{tikzpicture}
\end{document}
(Same result as above.)