In Tikz: unit tangent vectors to a curve, Jake helped with adding a tangent vector to the ellipse. However, in that question, the ellipse was oriented with the semi-major and minor axis in line with the x and y axis.
In this question TikZ: Drawing an ellipse through two points, Percusse helped with the constructing of a random elliptical arc which is what I am using here. So we don't know the alignment of the semi-major and minor axis. Maybe we can find the rotation of it, but I am not 100%
on that yet.
In the absence of this information, my question is how can I add a normal and tangent vector to the path ending at P2
?
Can Jake's answer be adapted, or do we need a different method due to the ambiguity of the elliptical orientation?
\documentclass[tikz]{standalone}
\usetikzlibrary{arrows,calc}
\begin{document}
\begin{tikzpicture}[
dot/.style = {outer sep = +0pt, inner sep = +0pt, shape = circle, draw = black, label = {#1}},
small dot/.style = {minimum size = 1pt, dot = {#1}},
big dot/.style = {minimum size = 2pt, dot = {#1}},
line join = round, line cap = round, >=triangle 45
]
\node[ fill = black, big dot = {below: \(F\)}] (F) at (0, 0) {};
\node[ fill = black, big dot = {below: \(P_1\)}] (P1) at (2, 0) {};
\node[ fill = black, big dot = {above right=.25cm:\(P_2\)}] (P2) at (-2, 2) {};
\begin{pgfinterruptboundingbox}
\begin{scope}[decoration = {markings,
mark = at position 0.5 with {\arrow{>}}
}]
\clip (2, 0) -- (-2, 0) -- (-2, 4) -- (2, 4) -- cycle;
\draw[name path global = ellp, postaction = decorate] let
\p0 = ($(P2) - (F)$),
\p1 = ($(P1) - (P2)$)
in (P2|-P1) ++ (\x1, 0) arc (0:100: \x1 and \y0);
\end{scope}
\end{pgfinterruptboundingbox}
\path[name path = aux1] (P2) circle [radius = 1bp];
\draw[name intersections = {of = ellp and aux1}, -latex] (P2) --
($(intersection-2)!.75cm!(intersection-1)$);
\end{tikzpicture}
\end{document}
name path
for it to work, and I'm not sure how to do that with low levelpgf
paths. Why are you usingpgf
syntax here, instead of a TikZ\draw
command?\pgfpatharcto
command, you specify the major and minor axis lengths and the rotation (3.25cm
,3cm
and0°
, in your example) and then let PGF shift the ellipse so that both the specified points lie on the ellipse.(F)
isn't necessarily the focus, though (and it's not in your code).calc
syntax(P2) -- ($(intersection-2)!.75cm!-90:(intersection-1)$)
, which rotates the coordinate around the(intersection-2)
point. See tex.stackexchange.com/a/120326/2552 for an explanation of the syntax.(P2) -- ($(P2)!0.75cm!-90:($(intersection-2)!.75cm!(intersection-1)$)$)
. That way, the vectors will be exactly 90 degrees apart.