椭圆与圆相交

椭圆与圆相交

我正在尝试绘制一个与影响范围相交的椭圆,即围绕月球的虚线圆。椭圆需要沿矢量穿过(-170.864:.7cm)位置v0并相交于(3.56699,.25)

从图中可以看出,我想要椭圆经过和的交点,r0然后在月球周围圆圈处的两条线的连线处相交。 v0v0在此处输入图片描述

\documentclass{article}
\usepackage{tikz, pgfplots}
\begin{document}
      \begin{tikzpicture}[line join = round, line cap = round, scale = 2,
      >=triangle 45]
        \draw (0,0) -- (4,0) node[scale = .45, fill = white] at (2,0) {$D$};
        \draw (0,0) -- (-45:4cm);
        \begin{scope}[decoration = {markings,
          mark = at position 0.5 with {\arrow{>}}, }]
          \draw[postaction = decorate] (-45:4cm) arc (-45:0:4cm);
        \end{scope}
        \draw (0,0) -- (3.56699,.25) node[scale = .75, fill = white]
        at (1.99511,.139831) {$r_1$};
        \draw (0:2.25cm) arc (0:4.00914:2.25cm) node[scale = .75] at (1.7:2.4cm) {$\gamma_1$};
        \begin{scope}[xshift = 4cm]
          \draw (0,0) -- (150:.5cm);
          \draw (-.2,0) arc (180:150:.2cm);
          \node[scale = .75] at (165:.3cm) {$\lambda$};
        \end{scope}
        \begin{scope}[rotate around = {-80.864: (0,0)}]
          \draw[-latex] (0,0) -- (0,-.7) node[left, scale = .75, fill = white, inner sep = .01cm] at (0,-.25) {$\mathbf{r}_0$};
          \draw[-latex] (0,-.7) -- (1,-.7) node[left, scale = .75]
          at (.4,-.7) {$\mathbf{v}_0$};
        \end{scope}
        \draw[dashed] (4,0) circle (.5cm);
        \draw[dashed] (0,0) circle (.7cm);
        \draw (-170.864:.4cm) arc (-170.864:0:.4cm) node[scale = .75,
        fill = white, inner sep = .01cm] at (-85:.4cm) {$\nu_1$};
        \path (4,0) node {\includegraphics[width = .3cm]{moon.png}};
        \path (0,0) node {\includegraphics[width = .6cm]{earth.png}};
        \path (-45:4cm) node {\includegraphics[width = .3cm]{moon.png}};
  \end{tikzpicture}

\end{document}

答案1

因此,我很幸运,旋转正好穿过了影响范围点。

在此处输入图片描述

\begin{center}
  \begin{tikzpicture}[line join = round, line cap = round, scale = 2,
    >=triangle 45]
    \draw (-170.864:.3cm) arc (-170.864:0:.3cm) node[scale = .75,
    fill = white, inner sep = .01cm] at (-85:.3cm) {$\nu_1$};
    \draw (-170.864:.5cm) arc (-170.864:-28.996:.5cm) node[scale = .75,
    fill = white, inner sep = .01cm] at (-90:.5cm) {$\gamma_0$};
    \draw (0,0) -- (4,0) node[scale = .45, fill = white] at (2,0) {$D$};
    \draw (0,0) -- (-28.966:4cm);
    \begin{scope}[decoration = {markings,
        mark = at position 0.5 with {\arrow{>}}, }]
      \draw[postaction = decorate] (-28.966:4cm) arc (-28.966:0:4cm);
  \end{scope}
    \draw (0,0) -- (3.56699,.25) node[scale = .75, fill = white]
    at (1.99511,.139831) {$r_1$};
    \draw (0:2.25cm) arc (0:4.00914:2.25cm) node[scale = .75] at (1.7:2.4cm)
    {$\gamma_1$};
    \begin{scope}[xshift = 4cm]
      \draw (0,0) -- (150:.5cm);
      \draw (-.2,0) arc (180:150:.2cm);
      \node[scale = .75] at (165:.3cm) {$\lambda$};
    \end{scope}
    \begin{scope}[rotate around = {-80.864: (0,0)}]
      \draw[-latex] (0,0) -- (0,-.7) node[left, scale = .75, fill = white,
      inner sep = .01cm] at (0,-.25) {$\mathbf{r}_0$};
      \draw[-latex] (0,-.7) -- (1,-.7) node[left, scale = .75]
      at (.4,-.7) {$\mathbf{v}_0$};
    \end{scope}
    \draw[dashed] (4,0) circle (.5cm);
    \draw[dashed] (0,0) circle (.7cm);
    \path (4,0) node {\includegraphics[width = .3cm]{moon.png}};
    \path (0,0) node {\includegraphics[width = .6cm]{earth.png}};
    \path (-28.996:4cm) node {\includegraphics[width = .3cm]{moon.png}};
    \begin{scope}[rotate around = {15: (-170.864:.7cm)}]
      \clip (-0.69112,-0.111145) -- (3.48,.25) -- (3.5,-1) --
      (-0.69112,-2) -- cycle;
      \draw (-170.864:.7cm) arc (-170.864:189.136:3cm and 1cm);
    \end{scope}
    \begin{scope}[rotate around = {15: (-170.864:.7cm)}]
      \draw[dashed] (-170.864:.7cm) arc (-170.864:189.136:3cm and 1cm);
    \end{scope}
  \end{tikzpicture}

编辑:

因此,我找到了一种使用圆弧构造椭圆截面的方法,而不必像上面那样随意绘制。

\documentclass[convert = false]{standalone}
\usepackage{tikz}                                                               
\usetikzlibrary{arrows}

\usetikzlibrary{calc}
\usetikzlibrary{decorations.markings}
\usetikzlibrary{intersections}

\usetikzlibrary{backgrounds}

\tikzset{
  partial circle/.style args = {#1:#2:#3}{
    insert path = {+ (#1:#3) arc (#1:#2:#3)}
  }
}

\begin{document}
\begin{tikzpicture}[line join = round, line cap = round, >=triangle 45,
  every label/.append style = {font = \tiny},
  dot/.style = {inner sep = 0pt, shape = circle,
    draw = black, label = {#1}},
  small dot/.style = {minimum size = .05cm, dot = {#1}},
  big dot/.style = {minimum size = .1cm, dot = {#1}},
  ]
  \def\d{6}
  \def\moonrad{.2}
  \def\earthrad{.5}
  \def\msoi{1}

  \coordinate (O) at (0, 0);
  \coordinate (Mi) at (-45:\d);
  \coordinate (Mf) at (0:\d);

  \begin{scope}[decoration = {markings,
      mark = at position 0.32 with {\arrow{latex}}
    }]
    \draw[postaction = decorate] (O) [partial circle = -60:60:\d];
  \end{scope}

  \draw (O) -- (Mi);
  \draw (O) -- (Mf) node[pos = .5, inner sep = 0, fill = white, font = \tiny]
  {D};
  \draw[-latex] (O) -- (-135:1.5cm) coordinate (r0)node[left, pos = .7,
  font = \tiny] {\(\mathbf{r}_0\)};

  \path[rotate = {209.5}, name path global = ell] (r0) arc[x radius = 4.5cm,
  y radius = 1.75cm, start angle = 0, end angle = 160];

  \foreach \position/\i in {Mi/1, Mf/2}{
    \draw[red, name path global/.expanded = circ\i] (\position)
    circle[radius = \msoi];
  }

  \node[coordinate, name intersections = {of = circ2 and ell}] (P1) at
  ($(intersection-2)$) {};

  \begin{pgfonlayer}{background}
    \begin{scope}[decoration = {markings,
        mark = between positions .1 and 1 step .15 with {\arrow{latex}},
      }]
      \begin{pgfinterruptboundingbox}
        \clip (P1)  rectangle ($(r0) + (-1, -2)$);
      \end{pgfinterruptboundingbox}

      \draw[postaction = decorate, rotate = {209.5}, name path global = ell]
      (r0) arc[x radius = 4.5cm, y radius = 1.75cm, start angle = 0,
      end angle = 160];
    \end{scope}
  \end{pgfonlayer}

  \draw[-latex] (O) -- (P1) node[font = \tiny, inner sep = 0, fill = white,
  pos = .5] {\(\mathbf{r}_1\)};
  \draw[-latex] (Mf) -- (P1) node[font = \tiny, pos = .6, right, fill = white,
  inner sep = 0] {\(R_{soi}\)};

  \shade[outer color = gray!70!blue!50, inner color = black!30!blue!90]
  (Mi) circle[radius = \moonrad];
  \shade[outer color = gray!70!blue!50, inner color = black!30!blue!90]
  (Mf) circle[radius = \moonrad];
  \shade[outer color = green!70!blue!50, inner color = black!30!green!90]
  (O) circle[radius = \earthrad];

  \draw[-latex] let
    \p0 = (O),
    \p1 = (r0),
    \p2 = (Mi),
    \n1 = {atan2(\x1 - \x0, \y1 - \y0)},
    \n2 = {atan2(\x2 - \x0, \y2 - \y0)},
    \n3 = {1cm},
    \n4 = {(\n1 + \n2) / 2}
  in (O) +(\n1:\n3) arc[radius = \n3, start angle = \n1, end angle = \n2]
  node[fill = white, inner sep = 0, font = \tiny] at ([shift = (O)] \n4:\n3)
  {\(\nu_0\)};

  \draw[-latex] let
    \p0 = (O),
    \p1 = (Mf),
    \p2 = (P1),
    \n1 = {atan2(\x1 - \x0, \y1 - \y0)},
    \n2 = {atan2(\x2 - \x0, \y2 - \y0)},
    \n3 = {2cm},
    \n4 = {(\n1 + \n2) / 2}
  in (O) +(\n1:\n3) arc[radius = \n3, start angle = \n1, end angle = \n2]
  node[fill = white, inner sep = 0, font = \tiny] at ([shift = (O)] \n4:2.2cm)
  {\(\nu_1\)};

  \draw[-latex] let
    \p0 = (Mf),
    \p1 = (O),
    \p2 = (P1),
    \n1 = {atan2(\x1 - \x0, \y1 - \y0)},
    \n2 = {atan2(\x2 - \x0, \y2 - \y0)},
    \n3 = {.7cm},
    \n4 = {(\n1 + \n2) / 2}
  in (Mf) +(\n1:\n3) arc[radius = \n3, start angle = \n1, end angle = \n2]
  node[fill = white, inner sep = 0, font = \tiny] at ([shift = (Mf)] \n4:\n3)
  {\(\lambda_1\)};
\end{tikzpicture}
\end{document}

在此处输入图片描述

相关内容