TikZ:双曲线轨迹的旋转曲面

TikZ:双曲线轨迹的旋转曲面

所以我不知道如何从注入点构造双曲轨迹的旋转曲面。为简单起见,让我们将注入点设为(0, 0)。不幸的是,我不知道该给出什么作为起点的 MWE。不过,我可以给出最基本的。

\documentclass[convert = false, tikz]{standalone}
% maybe these packages will be needed
%\usetikzlibrary{arrows}
%\usetikzlibrary{calc}
%\usetikzlibrary{intersections}
\begin{document}
\begin{tikzpicture}
\end{tikzpicture}
\end{document}

在此处输入图片描述

我仍在寻找一种能够接近复制图像的解决方案,因为我想在轨迹相交的地方画一个与地球相交的圆圈。

答案1

我把这些线近似为抛物线。像往常一样蒂克兹和 3D,这只在给定的配置下有效。表面由许多(3456)小块组成,你会看到平铺的痕迹。此外,结果让我想起了单眼卫星

代码

\documentclass[tikz,border=2mm]{standalone}
\usetikzlibrary{arrows}

\begin{document}

\begin{tikzpicture}[    x={(-30:1cm)},
    y={(90:1cm)},
    z={(45:1cm)},
    scale=2,
]   
    \foreach \d in {180,190,...,270}
    {   \foreach \z in {0.2,0.25,...,4.95}
        { \fill[opacity=0.4,red] ({cos(\d)*sqrt(\z)},{sin(\d)*sqrt(\z)},{\z}) -- ({cos(\d+10)*sqrt(\z)},{sin(\d+10)*sqrt(\z)},{\z}) -- ({cos(\d+10)*sqrt(\z+0.05)},{sin(\d+10)*sqrt(\z+0.05)},{\z+0.05}) -- ({cos(\d)*sqrt(\z+0.05)},{sin(\d)*sqrt(\z+0.05)},{\z+0.05}) -- cycle;
        }
    }

    \foreach \d in {180,190,...,280}
    {   %\fill[opacity=0.5]
        \draw[-latex,thick] ({cos(\d)*sqrt(0.2)},{sin(\d)*sqrt(0.2)},{0.2})
        \foreach \z in {0.2,0.25,...,5}
        { -- ({cos(\d)*sqrt(\z)},{sin(\d)*sqrt(\z)},{\z})};
    }

    \shade[ball color=blue!50!cyan] (0.15,0.01,0.73) circle (0.9cm);

    \foreach \d in {-80,-70,...,160}
    {   \foreach \z in {0.2,0.25,...,4.95}
        { \fill[opacity=0.5,red] ({cos(\d)*sqrt(\z)},{sin(\d)*sqrt(\z)},{\z}) -- ({cos(\d+10)*sqrt(\z)},{sin(\d+10)*sqrt(\z)},{\z}) -- ({cos(\d+10)*sqrt(\z+0.05)},{sin(\d+10)*sqrt(\z+0.05)},{\z+0.05}) -- ({cos(\d)*sqrt(\z+0.05)},{sin(\d)*sqrt(\z+0.05)},{\z+0.05}) -- cycle;
        }
    }

    \foreach \d in {-70,-60,...,170}
    {   \draw[-latex,thick] ({cos(\d)*sqrt(0.2)},{sin(\d)*sqrt(0.2)},{0.2})
        \foreach \z in {0.2,0.25,...,5}
        { -- ({cos(\d)*sqrt(\z)},{sin(\d)*sqrt(\z)},{\z})};
    }

    \draw[very thick, green] (0,0,0.2) circle ({sqrt(0.2)});
\end{tikzpicture}

\end{document}

输出

在此处输入图片描述

答案2

以下是使用 PGFPlots 实现此目的的一种方法。请注意,这涉及到相当多的捏造,因为 PGFPlots 无法对来自不同\addplot命令的元素进行排序:

\documentclass[border=5mm]{standalone}
\usepackage{pgfplots}
\begin{document}
\begin{tikzpicture}
\begin{axis}[
    axis equal image,
    hide axis,
    width=10cm
]
\addplot3 [
    z buffer=sort,
    surf,
    samples=15,
    samples y=35,
    y domain=0:360,
    fill=yellow!80,
    draw opacity=0,
    line join=round,
] ({x*cos(y)}, {sqrt(1 + x^2)*3}, {x*sin(y)});

\pgfplotsinvokeforeach{-60,-30,...,180}{
\addplot3 [
    samples y=1,
    draw=black,
    samples=15,
    domain=0.5:5, -latex
] ({x*cos(#1)}, {sqrt(1 + x^2)*3}, {x*sin(#1)});
}



\addplot3 [
    samples y=1,
    samples=51,dashed,
    domain=0:360
] ({5*cos(x)}, {sqrt(1 + 5^2)*3}, {5*sin(x)});


\addplot3 [
    samples y=1,
    samples=51,
    domain=0:360
] ({0.5*cos(x)}, {sqrt(1 + 0.55^2)*3}, {0.5*sin(x)});
\end{axis}
\end{tikzpicture}
\end{document}

相关内容