使用 TikZ 的 Tractrix 和伪球面

使用 TikZ 的 Tractrix 和伪球面

我想使用 TikZ 绘制 Tractrix 和相应的伪球面。

我的第一次尝试没有成功:

\begin{tikzpicture}[scale=0.5, samples=100]
\draw[->] (-3.8,0) -- (10,0) node[right] {$x$};
\draw[->] (0,-5) -- (0,5) node[left] {$y$};
\draw[smooth, domain = 0.05:1.95, color=red] plot (\x,3*(ln((3+sqrt(9-(\x)^2)/(\x))-sqrt(9-(\x)^2));
\end{tikzpicture}

我使用了维基百科的公式:https://en.wikipedia.org/wiki/Tractrix

答案1

这些都是我之前画的旧图,在你提问之前。但我认为它们可以回答你的问题。你可以根据需要调整它们。

这是一个用 tikz 制作的 tractrix

\documentclass {standalone}    
\usepackage    {tikz}
\usetikzlibrary{calc}
\begin{document}
\begin{tikzpicture}[line cap=round,line join=round]
  \def\d{3};
  \def\xmin{-1};
  \pgfmathsetmacro\xmax{\d-\xmin};
  \def\ymin{-2};
  \def\ymax{6};
  \def\a{140}; % t parameter for A1 (lower point in the curve)
  \pgfmathsetmacro\ax{\d*sin(\a)}; % x for A1
  \pgfmathsetmacro\ay{\d*cos(\a)+\d*ln(tan(\a/2)}; % y for A1
  \pgfmathsetmacro\az{\ay+sqrt(\d*\d-\ax*\ax)};    % y for A2 (lower point in y axis)
  \def\b{155}; % t parametar for B1 (higher point in the curve)
  \pgfmathsetmacro\bx{\d*sin(\b)}; % x for B1
  \pgfmathsetmacro\by{\d*cos(\b)+\d*ln(tan(\b/2)}; % y for B1
  \pgfmathsetmacro\bz{\by+sqrt(\d*\d-\bx*\bx)};    % y for B2 (higher point in y axis)
  \pgfmathsetmacro\ang{atan(\ay/\ax)}; % angle between A1-O and x axis
  \def\r{0.5}; % Radius for t arc
  \coordinate (O)  at (0,0);
  \coordinate (A1) at (\ax,\ay);
  \coordinate (A2) at (0,\az);
  \coordinate (B1) at (\bx,\by);
  \coordinate (B2) at (0,\bz);
  \coordinate (T)  at (45+0.5*\ang:\r);
  \draw[->] (\xmin,0)--(\xmax,0) node[below] {$x$};
  \draw[->] (0,\ymin)--(0,\ymax) node[left]  {$y$};
  \draw[->] (90:\r cm) arc[radius=\r,start angle=90,end angle=\ang]; % Arc for t label
  \begin{scope}
    \clip (0,\ymin) rectangle (\xmax,\ymax);
    \draw[thick,magenta,smooth,samples=50,domain=1:179,variable=\t] plot ({\d*sin(\t)},{\d*cos(\t)+\d*ln(tan(\t/2)}); % Tractrix
  \end{scope}
  \draw[dashed] (O) --(A1);
  \draw         (A1)--(A2);
  \draw         (B1)--(B2);
  \draw[fill=white] (O)  circle (1pt) node [below left]  {$O$};
  \draw[fill=white] (A1) circle (1pt) node [above right] {$\alpha(t)$};
  \draw[fill=white] (A2) circle (1pt);
  \draw[fill=white] (B1) circle (1pt);
  \draw[fill=white] (B2) circle (1pt);
  \fill[white] (T) circle (0.15);
  \node at (0.5*\d,0)        [below] {$d$};
  \node at ($(A1)!0.5!(A2)$) [below] {$d$};
  \node at ($(B1)!0.5!(B2)$) [below] {$d$};
  \node at (T) {$t$};
\end{tikzpicture}
\end{document}

在此处输入图片描述

现在有了几个伪球面(从视图上看,它们实际上是相同的),用 pgfplots 制作。

\documentclass {standalone}    
\usepackage    {pgfplots}
\pgfplotsset   {compat=1.17}
\begin{document}
\begin{tikzpicture}
\begin{axis}
  [
    view={40}{30},
    axis on top=false,
    xtick=\empty,
    ytick=\empty,
    ztick=\empty
  ]
  \def\d{1};
  \addplot3[surf,domain=0:360,domain y= 0: 90,samples=31,samples y=20]({\d*cos(x)*sin(y)},{\d*sin(x)*sin(y)},{\d*cos(y)+\d*ln(tan(y/2)});
  \addplot3[surf,domain=0:360,domain y=90:180,samples=31,samples y=20]({\d*cos(x)*sin(y)},{\d*sin(x)*sin(y)},{\d*cos(y)+\d*ln(tan(y/2)});
\end{axis}
\end{tikzpicture}
\hspace{0.5cm}
\begin{tikzpicture}
\begin{axis}
  [
    view={20}{-20},
    axis on top=true,
    xtick=\empty,
    ytick=\empty,
    ztick=\empty
  ]
  \def\d{1};
  \addplot3[surf,domain=0:360,domain y= 0: 90,samples=31,samples y=20]({\d*cos(x)*sin(y)},{\d*sin(x)*sin(y)},{\d*cos(y)+\d*ln(tan(y/2)});
  \addplot3[surf,domain=0:360,domain y=90:180,samples=31,samples y=20]({\d*cos(x)*sin(y)},{\d*sin(x)*sin(y)},{\d*cos(y)+\d*ln(tan(y/2)});  
\end{axis}
\end{tikzpicture}
\end{document}

在此处输入图片描述

相关内容