在 tikz 中绘制两个相切圆锥体

在 tikz 中绘制两个相切圆锥体

我想在 tikz 中绘制两个沿公共母线相切的圆锥,如下图所示。我设法绘制了垂直圆锥(即使考虑到绘制的两个母线应该与椭圆相切,因此它们的端点不是长半轴的端点),但我不确定如何绘制倾斜圆锥。任何帮助都将不胜感激。

在此处输入图片描述

答案1

也许这是一个开始。我只是从另一篇帖子但这仅适用于主坐标。我认为圆锥体的顶部圆圈是正确的,并且圆锥体是切线的。

\documentclass[tikz,border=3mm]{standalone}
\usepackage{amsmath}
\usepackage{tikz-3dplot}
\usetikzlibrary{intersections}
\begin{document}
\tdplotsetmaincoords{70}{20}
\begin{tikzpicture}[tdplot_main_coords,line join=round, line cap=round,
 declare function={H=4;alpha=25;beta=15;
    ha=H*cos(alpha);ra=H*sin(alpha);
    hb=H*cos(beta);rb=H*sin(beta);}]
 \draw (0,0,0) coordinate (O) -- (5,0,0) node[below]{$1$}
  (O) -- (0,5,0) node[below]{$2$};
 \path (O) -- (0,0,5) coordinate (z);
 \begin{scope}[canvas is xy plane at z=ha]
  % https://tex.stackexchange.com/a/540838
  \pgfmathsetmacro{\alphacrit}{90-acos(ra*cos(\tdplotmaintheta)/ha)}% 
  \draw  (\tdplotmainphi-\alphacrit:ra) coordinate (c1) -- (O)
   -- (180+\tdplotmainphi+\alphacrit:ra) coordinate (c2);
  \draw (0,0) circle[radius=ra];
 \end{scope} 
 \draw[dashed] (O) -- (0,0,{ha-ra*cos(\tdplotmaintheta)}) coordinate (i1);
 \draw[thick,-stealth] (i1) -- (0,0,5) node[above right]{$\boldsymbol{L}$};
 \tdplotsetrotatedcoords{\tdplotmainphi-180}{alpha+beta}{0}
 \begin{scope}[tdplot_rotated_coords]
  \draw[name path=z'] (O) -- (0,0,5) coordinate[label=above:{$3$}](z');
  \begin{scope}[canvas is xy plane at z=hb]
   % https://tex.stackexchange.com/a/540838
   \pgfmathsetmacro{\alphacrit}{90-acos(rb*cos(\tdplotmaintheta)/hb)}% 
   \draw  (\tdplotmainphi-\alphacrit:rb) coordinate (c3) -- (O)
     (90+\tdplotmainphi:rb) coordinate (i2);
   \draw[name path=circb] (0,0) circle[radius=rb];
   \draw[dashed,name intersections={of=circb and z',by=i2}] (O) -- (i2);
  \end{scope} 
  \draw[-stealth] (i2) -- (0,0,4.5) node[left]{$\boldsymbol{L_3}$}; 
 \end{scope}
\end{tikzpicture}
\end{document}

在此处输入图片描述

相关内容