Tikz에서 점근선을 사용하여 쌍곡선의 한 가지 그리기

Tikz에서 점근선을 사용하여 쌍곡선의 한 가지 그리기

나는 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}

그러나 보시다시피 저는 단지 하나의 가지인 그래프의 위쪽 부분을 그리는 데에만 관심이 있습니다. 매우 큰 축으로 끝나기 때문에 이를 얻는 방법을 모르겠습니다(이해가 되지 않습니다). 축 a_1 및 a_2를 구축하는 메커니즘). 예를 들어 점근선의 위쪽 부분만 원하고 첫 번째 좌표로 lengthasymptote = 0을 입력하면 전체 그림이 오른쪽으로 이동합니다.

매우 우아하고 깔끔해 보이기 때문에 원하는 결과를 얻으려면 이 스크립트를 이해하는 데 도움을 주시면 감사하겠습니다.

감사합니다.

여기에 이미지 설명을 입력하세요

관련 정보