tikz で漸近線を持つ双曲線の 1 つの枝を描く

tikz で漸近線を持つ双曲線の 1 つの枝を描く

私は tikz を使って双曲線の単一の枝を描こうとしており、このフォーラムのこの投稿 (@DouglasMencken) で素晴らしいスクリプトを見つけました。この郵便受け

\documentclass[tikz, margin=10]{standalone}

\usepackage{bm}

\usepackage{tikz}
\usetikzlibrary{shapes.geometric} % for shape=ellipse
\usetikzlibrary{calc}

\begin{document}

\def\tikzscale{0.8}
\begin{tikzpicture}[scale=\tikzscale]

\tikzset{
    elli/.style args={#1:#2and#3}{
        draw,
        shape=ellipse,
        rotate=#1,
        minimum width=2*#2,
        minimum height=2*#3,
        outer sep=0pt,
    }
}

%
% #1 optional parameters for \draw
% #2 angle of rotation in degrees
% #3 offset of center as (pointx, pointy) or (name-o-coordinate)
% #4 length of plus (semi)axis, that is axis which hyperbola crosses
% #5 length of minus (semi)axis
% #6 how much of hyperbola to draw in degrees, with 90 you’d reach infinity
%
\newcommand\tikzhyperbola[6][thick]{%
    \draw [#1, rotate around={#2: (0, 0)}, shift=#3]
        plot [variable = \t, samples=1000, domain=-#6:#6] ({#4 / cos( \t )}, {#5 * tan( \t )});

}

\def\angle{90}
\def\bigaxis{1.5cm}
\def\smallaxis{1.5cm}

\coordinate (center) at (0, 0);

\node [scale=\tikzscale, elli=\angle:\bigaxis and \smallaxis, line width = 1.2pt, color=black, dotted] at (center) (e) {};

\draw [-{stealth}, line width = 1.2pt, color = orange] ([shift={(\angle:-12)}] e.center) -- ([shift={(\angle:12)}] e.center) node [above right] {$\bm{a}_1$};
\draw [-{stealth}, line width = 1.2pt, color = orange] ([shift={(90+\angle:-8)}] e.center) -- ([shift={(90+\angle:8)}] e.center) node [above left]  {$\bm{a}_2$};

\tikzhyperbola[line width = 1.2pt, color=blue!80!black]{\angle}{(center)}{\bigaxis}{\smallaxis}{77}

\pgfmathsetmacro\axisratio{\smallaxis / \bigaxis}

% asymptotes
\def\lengthofasymptote{15}
\draw [color=black!40, line width = 0.4pt, rotate around={\angle + atan( \axisratio ): (center)}]
    ($ (-\lengthofasymptote, 0) + (center) $) -- ++(2*\lengthofasymptote, 0) ;
\draw [color=black!40, line width = 0.4pt, rotate around={\angle - atan( \axisratio ): (center)}]
    ($ (-\lengthofasymptote, 0) + (center) $) -- ++(2*\lengthofasymptote, 0) ;


\end{tikzpicture}

\end{document}

しかし、ご覧のとおり、私が興味があるのは、1 つのブランチのみであるグラフの上部をプロットすることだけです。軸が非常に大きくなるため、これをどのように取得すればよいのかわかりません (軸 a_1 と a_2 を構築するメカニズムがわかりません)。たとえば、漸近線の上部のみが必要で、最初の座標として lengthasymptote = 0 を設定すると、図全体が右にシフトされます。

このスクリプトは非常にエレガントでクリーンなように見えるので、望ましい結果を得るためにこのスクリプトを理解するための助けをいただければ幸いです。

ありがとう。

ここに画像の説明を入力してください

関連情報