0

In the MWE the points P and M are the same although they are defined by different coordinates (by (0,0) and (0,3) respectively). (My aim is to define a point M on the blue polar and should be different from the touching point P and lying inside the ellipse.)

It seems that \coordinate[use tangent] (M) at (0,3); does not work properly, but it does with (0,0).

The tangent definition is from How do I make tangents to ellipses and lines parallel to these?

\documentclass{standalone}
\usepackage{tikz}
\usetikzlibrary{calc}
\usetikzlibrary{decorations.markings}
\usetikzlibrary{intersections}
\usepackage{pgfplots}
\pgfplotsset{compat=1.15}

\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 ] \def\a{4} % major half axis \def\b{2} % minor half axis \draw[thick, tangent=0.35] (0,0) ellipse ({\a} and {\b}); %polar \draw [blue, thick, use tangent] (0,3) -- (0,-2); \coordinate[use tangent] (P) at (0,0); \coordinate[use tangent] (M) at (0,3); \filldraw (P) circle (2pt); \node[left] at (P) {$P$}; \node[right] at (M) {$M$}; \end{tikzpicture} \end{document}

image

1 Answers1

1

enter image description here

You need to invoke use tangent each time when you want to draw something in the tangent frame (the correct name should be Frenet frame). I rewrote your code using a scope; I think it's easier to follow.

The code

\documentclass[margin=.5cm]{standalone}
\usepackage{tikz}
\usetikzlibrary{calc}
\usetikzlibrary{decorations.markings}
\usetikzlibrary{intersections}

\begin{document} \tikzset{ tangent/.style={ decoration={ markings,% switch on markings mark=at position #1 with { \coordinate (tangent point-% \pgfkeysvalueof{/pgf/decoration/mark info/sequence number}) at (0, 0); \coordinate (tangent vector-% \pgfkeysvalueof{/pgf/decoration/mark info/sequence number}) at (1, 0); \coordinate (normal vector-% \pgfkeysvalueof{/pgf/decoration/mark info/sequence number}) at (0, 1); } }, postaction=decorate }, use tangent/.style={ shift=(tangent point-#1), x=(tangent vector-#1), y=(normal vector-#1) }, use tangent/.default=1 }

\def\a{4} % major half axis \def\b{2} % minor half axis

\begin{tikzpicture} \draw[thick, tangent=0.3] (0, 0) ellipse ({\a} and {\b});

% polar \begin{scope}[use tangent] \draw [blue, thick] (0, 3) -- (0, -1); \draw[fill=white] (0, 0) coordinate (P) circle (2pt) node[above left] {$P$} (0, 3) coordinate (M) circle (2pt) node[below right] {$M$}; \end{scope} \end{tikzpicture} \end{document}

Daniel N
  • 5,687