Tikz:从焦点到椭圆边缘画一条线

Tikz:从焦点到椭圆边缘画一条线

这个问题类似于Tikz:将两个向量从椭圆的焦点连接到边缘但不一样。

在这个例子中,我希望线的长度为特定距离。如果圆心位于原点,那么我到边缘的线将只位于第一和第二象限。我想从 F 到椭圆的边缘构造一条单位长度的线。但我不知道哪个角度会有这个长度。对于第二条线,我希望它的长度为。1.524这些长度分别标记为ronertwo

rone还有一个警告,和之间的角度rtwo应该是107度,标记为deltanu

\documentclass{article}
\usepackage{tikz}
\begin{document}
\begin{tikzpicture}[scale = 1.5,
    every label/.append style = {font = \small},
    dot/.style = {outer sep = +0pt, inner sep = +0pt,
      shape = circle, draw = black, label = {#1}},
    dot/.default =,
    small dot/.style = {minimum size = 2.5pt, dot = {#1}},
    small dot/.default =,
    big dot/.style = {minimum size = 5pt, dot = {#1}},
    big dot/.default =
    ]
    \pgfmathsetmacro{\e}{0.2768}
    \pgfmathsetmacro{\etilde}{0.6789}
    \pgfmathsetmacro{\rone}{1}
    \pgfmathsetmacro{\rtwo}{1.524}
    \pgfmathsetmacro{\deltanu}{107}
    \pgfmathsetmacro{\a}{1.36}
    \pgfmathsetmacro{\am}{1.1442}
    \pgfmathsetmacro{\b}{\a * sqrt(1 - \e^2)}
    \pgfmathsetmacro{\btilde}{\a * sqrt(1 - (\etilde)^2)}
    \pgfmathsetmacro{\c}{sqrt(\a^2 - \b^2)}
    \pgfmathsetmacro{\ctilde}{sqrt(\a^2 - (\btilde)^2)}
    \node[scale = .75, fill, big dot = {below: \(F\)}] (F) at (0, 0) {};
    \node[scale = .75, fill = none, big dot = {below: \(F^*\)}] (FS)
    at (-2 * \c cm, 0) {};
    \draw (-\c,0) ellipse (\a cm and \b cm);
    \draw[red, thick] (0, 0) circle (1.523679cm);
    \draw[blue, thick] (0, 0) circle (1cm);
  \end{tikzpicture}
\end{document}

我的猜测是交叉库,但我不知道它如何实现。

在此处输入图片描述

在此处输入图片描述

在此处输入图片描述

答案1

随着的正确值= 0.2678,你可以使用该intersections库来找到点 P1 和 P2:

\documentclass[border=5mm]{standalone}
\usepackage{tikz}
\usetikzlibrary{intersections, calc}
\begin{document}
\begin{tikzpicture}[scale = 1.5,
    every label/.append style = {font = \small},
    dot/.style = {outer sep = +0pt, inner sep = +0pt,
      shape = circle, draw = black, label = {#1}},
    dot/.default =,
    small dot/.style = {minimum size = 2.5pt, dot = {#1}},
    small dot/.default =,
    big dot/.style = {minimum size = 5pt, dot = {#1}},
    big dot/.default =
    ]
    \pgfmathsetmacro{\e}{0.2768}
    \pgfmathsetmacro{\etilde}{0.68}
    \pgfmathsetmacro{\rone}{1}
    \pgfmathsetmacro{\rtwo}{1.524}
    \pgfmathsetmacro{\deltanu}{107}
    \pgfmathsetmacro{\a}{1.36}
    \pgfmathsetmacro{\am}{1.14}
    \pgfmathsetmacro{\b}{\a * sqrt(1 - \e^2)}
    \pgfmathsetmacro{\btilde}{\a * sqrt(1 - (\etilde)^2)}
    \pgfmathsetmacro{\c}{sqrt(\a^2 - \b^2)}
    \pgfmathsetmacro{\ctilde}{sqrt(\a^2 - (\btilde)^2)}
    \node[scale = .75, fill, big dot = {below: \(F\)}] (F) at (0, 0) {};
    \node[scale = .75, fill = none, big dot = {below: \(F^*\)}] (FS)
    at (-2 * \c cm, 0) {};
    \draw [name path=ellipse] (-\c,0) ellipse (\a cm and \b cm);
    \draw [red, thick, name path=r2] (0, 0) circle (1.523679cm);
    \draw [blue, thick, name path=r1] (0, 0) circle (1cm);

    \draw [name intersections={of=ellipse and r1}] (F) -- (intersection-1) coordinate (P1) node [fill,big dot=right:P1, minimum size=3pt] {};
    \draw [name intersections={of=ellipse and r2}] (F) -- (intersection-1) coordinate (P2) node [fill,big dot=above left:P2, minimum size=3pt] {};

    \draw let
            \p0=(F),
            \p1=(P1),
            \p2=(P2),
            \n1={atan2(\x1-\x0,\y1-\y0)},
            \n2={atan2(\x2-\x0,\y2-\y0)},
            \n3={1em}
        in (F) +(\n1:\n3) arc [radius=\n3, start angle=\n1, end angle=\n2] node [pos=0.5,above] {\pgfmathparse{\n2-\n1}%
        $\pgfmathprintnumber{\pgfmathresult}^\circ$
        };
  \end{tikzpicture}
\end{document}

相关内容