Tikz:将节点放置在双曲线上两个圆的交点处

Tikz:将节点放置在双曲线上两个圆的交点处

我知道可以使用交集包来找到交点,但我还不明白如何做到这一点。

我想标记交叉点的递增顺序F^*_2,,F^*_1。(但用 ~ 表示),并F^*_m使用相同的表示。 F^*_1F^*_2

注意:我忽略了最下部和最上部的交叉点。

代码如下:

\documentclass[tikz,convert=false]{standalone}
\usetikzlibrary{through,calc}
\makeatletter
\tikzset{circle through extra radius/.code={% unorthodox addon for the through library
                                            % needs to be used after 'circle through'!
                                            % this can be avoided by slightly changing the source
  \tikz@addoption{%
    \pgfmathsetlengthmacro\pgf@tempa{\pgfkeysvalueof{/pgf/minimum width}+2*(#1)}%
    \pgfset{/pgf/minimum width/.expanded=\pgf@tempa}%
  }%
}}
\tikzset{
  special style/.code={%
    \if#1\tikz@nonactiveexlmark
      \pgfkeysalso{@special style}%
    \else
      \pgfkeysalso{style/.expanded=#1}%
    \fi
  },
  @special style/.style={draw=none,fill=none}
}
\makeatother
\begin{document}
\begin{tikzpicture}[
  every label/.append style={font=\small},
  dot/.style={fill,outer sep=+0pt,inner sep=+0pt,minimum size=2pt,shape=circle,draw=none,label={#1}},
  dot/.default={}
]
\begin{scope}[rotate around ={-20.5560452:(1, -.75)}]
      \node[scale = .75, dot = {right: \(P_1\)}] (P1) at (3cm, 0) {};
      \node[scale = .75, dot = {\(P_2\)}] (P2) at (-1, 0) {};
      \node[scale = .75, dot = {below: \(F\)}] (F) at (1cm, -.75cm) {};
      \path[blue] (F) edge (P1) edge (P2) (P1) edge (P2);
      \path ($(P1)!.75!(P2)$) coordinate (half-center);
      \foreach \sStyle/\xFocus in {{draw, thick}/half}
        \foreach \cPoint in {1, 2}
          \foreach \sStyleR/\dDeltaRadius[count = \cRadius from 0] in
          {/.0cm, /.5cm, /1cm, /1.5cm}
          {
            \node[style/.expanded = \sStyle,
            special style/.expanded = {\sStyleR}] at (P\cPoint.center)
            ({\xFocus:\cPoint:\cRadius}) [circle through/.expanded =
            {(\xFocus-center)}, circle through extra radius = \dDeltaRadius] {};
            \global\let\cRadius\cRadius
         }

      \clip(-4, -5) rectangle (8, 5);
      \draw [samples = 50, domain = -0.99:0.99, xshift = 1cm, red,
      thick] plot ({(-1 - (\x)^2) / (1 - (\x)^2)},
      {1.73 * (-2) * (\x) / (1 - (\x)^2)});
    \end{scope}
  \end{tikzpicture}
  \end{document}

在此处输入图片描述

来自我的帖子Tikz:绘制具有指定原点的同心圆和连接交点的圆弧 Qrrbrbirlbel 发现与

\foreach \cSolution in {1,2}
    \foreach \cRadius in {1,...,3}
    \coordinate (i-\cRadius-\cSolution) at (intersection cs: first node={F:1:\cRadius}, second node={F:2:\cRadius}, solution=\cSolution);

但我不清楚如何使解决方案适应我的问题。

编辑1:

我不知道是否有一种顺利的方法来实现该过程的自动化,但我将中间点定义为:

\node[scale = .75, dot = {right:\(\overset{\mbox{~}}{F}_m^*\)}] (Fm)
      at ($(P1)!.75!(P2)$) {};

我怎样才能使点变大并且~不出现重叠。我试过了\~~但没用。

编辑2:

关闭 Qrr 的输出。答案:

没有\tilde重叠,节点位置也不相似。

在此处输入图片描述

编辑3:

我可以调整一些节点,但是对于沿双曲线的节点,如果我对它们进行更多调整,顶部节点就会移位。

在此处输入图片描述

\begin{tikzpicture}[scale = .7,
    every label/.append style = {font = \small},
    dot/.style = {fill, outer sep = +0pt, inner sep = +0pt,
      shape = circle, draw = none, label = {#1}},
    dot/.default =,
    small dot/.style = {minimum size = 2pt, dot = {#1}},
    small dot/.default =,
    big dot/.style = {minimum size = 3pt, dot = {#1}},
    big dot/.default =
  ]
    \begin{scope}[rotate around ={-23.9625:(.75, -1)}]
      \begin{scope}
        \clip(-2, -4) rectangle (0, 4);
        \draw [samples = 50, domain = -0.99:0.99, xshift = 1cm, red, thick]
        plot ({(-1 - (\x)^2) / (1 - (\x)^2)},
        {1.73 * (-2) * (\x) / (1 - (\x)^2)});
      \end{scope}
      \node[scale = .75, small dot = {right: \(P_1\)}] (P1) at (3, 0) {};
      \node[scale = .75, small dot = {below, left = 3.5pt: \(P_2\)}] (P2) at
      (-1, 0) {};
      \node[scale = .75, small dot = {below, left = 3.5pt: \(F\)}] (F)
      at (.75, -1) {};
      \path[blue] (F) edge (P1) edge (P2) (P1) edge (P2);
      \path ($(P1)!.75!(P2)$) coordinate (Fm) node[big dot =
      {below = 10pt, right = 3pt: \(F_m^*\)}] {};
      \foreach \cPoint in {1, 2}
        \foreach \sStyleR/\dDeltaRadius[count = \cRadius from 0] in
        {.0cm, .5cm, 1cm}
          \node[draw, thick] at (P\cPoint.center) (\cPoint: \cRadius)
          [circle through = (Fm), circle through extra radius = \dDeltaRadius]
          {};
      \foreach \cSolution in {1, 2}
        \foreach \cRadius in {1, 2}
          \node[black, big dot = {right = 2pt, below = 2pt:
            $\ifnum\cSolution = 2\expandafter\tilde\fi F^*_\cRadius$}]
          (n-\cRadius-\cSolution) at
          (intersection cs: first node = {1: \cRadius},
                            second node = {2: \cRadius},
                            solution = \cSolution) {};
    \end{scope}
  \end{tikzpicture}

答案1

您可以使用相同的\foreach循环进行标记:

\foreach \cSolution in {1,2}
  \foreach \cRadius in {1,...,2}
    \node[green,dot={right:$\ifnum\cSolution=2\expandafter\tilde\fi F^*_\cRadius$}]
         (n-\cRadius-\cSolution)
      at (intersection cs: first node={1:\cRadius},
                          second node={2:\cRadius},
                            solution=\cSolution) {};

背后的数学intersection cs似乎有点不精确,所以我用图书馆重复了这项任务intersections

(我也清理了一点。)

代码 (intersection cs

\documentclass[tikz,convert=false]{standalone}
\usetikzlibrary{through,calc}
\makeatletter
\tikzset{circle through extra radius/.code={% unorthodox addon for the through library
                                            % needs to be used after 'circle through'!
                                            % this can be avoided by slightly changing the source
  \tikz@addoption{%
    \pgfmathsetlengthmacro\pgf@tempa{\pgfkeysvalueof{/pgf/minimum width}+2*(#1)}%
    \pgfset{/pgf/minimum width/.expanded=\pgf@tempa}%
  }%
}}
\makeatother
\begin{document}
\begin{tikzpicture}[
  every label/.append style={font=\small},
  dot/.style={fill,outer sep=+0pt,inner sep=+0pt,shape=circle,draw=none,label={#1}},
  dot/.default=,
  small dot/.style={minimum size=2pt,dot={#1}},
  small dot/.default=,
  big dot/.style={minimum size=3pt,dot={#1}},
  big dot/.default=
]
\begin{scope}[rotate around ={-20.5560452:(1, -.75)}]
      \node[small dot = {right: \(P_1\)}] (P1) at (3cm, 0) {};
      \node[small dot = {\(P_2\)}]        (P2) at (-1, 0) {};
      \node[small dot = {below: \(F\)}]   (F)  at (1cm, -.75cm) {};
      \path[blue] (F) edge (P1) edge (P2) (P1) edge (P2);
      \path ($(P1)!.75!(P2)$) coordinate (Fm) node[dot={right:$F_m^*$}] {};
      \foreach \cPoint in {1, 2}
        \foreach \sStyleR/\dDeltaRadius[count = \cRadius from 0] in {.0cm, .5cm, 1cm, 1.5cm}
            \node[draw] at (P\cPoint.center) (\cPoint:\cRadius) [circle through=(Fm), circle through extra radius = \dDeltaRadius] {};
      \foreach \cSolution in {1,2}
        \foreach \cRadius in {1,2}
          \node[green,big dot={right:$\ifnum\cSolution=2\expandafter\tilde\fi F^*_\cRadius$}]
            (n-\cRadius-\cSolution) at (intersection cs: first node={1:\cRadius},
                                                        second node={2:\cRadius},
                                                           solution=\cSolution) {};

      \clip(-4, -5) rectangle (8, 5);
      \draw [samples = 50, domain = -0.99:0.99, xshift = 1cm, red,
      thick] plot ({(-1 - (\x)^2) / (1 - (\x)^2)},
      {1.73 * (-2) * (\x) / (1 - (\x)^2)});
\end{scope}
\end{tikzpicture}
\end{document}

输出 (intersection cs

在此处输入图片描述

代码(intersections库)

\documentclass[tikz,convert=false]{standalone}
\usetikzlibrary{through,calc,intersections}
\makeatletter
\tikzset{circle through extra radius/.code={% unorthodox addon for the through library
                                            % needs to be used after 'circle through'!
                                            % this can be avoided by slightly changing the source
  \tikz@addoption{%
    \pgfmathsetlengthmacro\pgf@tempa{\pgfkeysvalueof{/pgf/minimum width}+2*(#1)}%
    \pgfset{/pgf/minimum width/.expanded=\pgf@tempa}%
  }%
}}
\makeatother
\begin{document}
\begin{tikzpicture}[
  every label/.append style={font=\small},
  dot/.style={fill,outer sep=+0pt,inner sep=+0pt,shape=circle,draw=none,label={#1}},
  dot/.default=,
  small dot/.style={minimum size=2pt,dot={#1}},
  small dot/.default=,
  big dot/.style={minimum size=3pt,dot={#1}},
  big dot/.default=
]
\begin{scope}[rotate around ={-20.5560452:(1, -.75)}]
      \node[small dot = {right: \(P_1\)}] (P1) at (3cm, 0) {};
      \node[small dot = {\(P_2\)}]        (P2) at (-1, 0) {};
      \node[small dot = {below: \(F\)}]   (F)  at (1cm, -.75cm) {};
      \path[blue] (F) edge (P1) edge (P2) (P1) edge (P2);
      \path ($(P1)!.75!(P2)$) coordinate (Fm) node[dot={right:$F_m^*$}] {};
      \foreach \cPoint in {1, 2}
        \foreach \dDeltaRadius[count = \cRadius from 0] in {.0cm, .5cm, 1cm, 1.5cm}
            \node[draw, name path global/.expanded=\cPoint:\cRadius] at (P\cPoint.center) (\cPoint:\cRadius) [circle through=(Fm), circle through extra radius = \dDeltaRadius] {};
      \foreach \cRadius in {1,2} {
        \tikzset{name intersections={of/.expanded={1:\cRadius} and 2:\cRadius,name/.expanded=n'-\cRadius}}
        \foreach \cSolution in {1,2}
          \node[green,big dot={right:$\ifnum\cSolution=2\expandafter\tilde\fi F^*_\cRadius$}] (n-\cRadius-\cSolution) at (n'-\cRadius-\cSolution){};
      }

      \clip (-4, -5) rectangle (8, 5);
      \draw [samples = 50, domain = -0.99:0.99, xshift = 1cm, red,
      thick] plot ({(-1 - (\x)^2) / (1 - (\x)^2)},
      {1.73 * (-2) * (\x) / (1 - (\x)^2)});
\end{scope}
\end{tikzpicture}
\end{document}

输出(intersections库)

在此处输入图片描述

相关内容