绘制时钟阵列和正弦波

绘制时钟阵列和正弦波

绘制此图形的简单方法是什么?我尝试使用 tikz 绘制此图形。但我无法轻松地将正弦波与箭头匹配...我决定使用 Keynote(结果如下),并寻求有关 tikz 或 LaTex 的帮助?

在此处输入图片描述

谢谢你!

答案1

tikz-3dplot可以调整视角。

\documentclass[tikz,border=3mm]{standalone}
\usepackage{tikz-3dplot}
\begin{document}
\tdplotsetmaincoords{70}{0}
\begin{tikzpicture}[scale=2]
\foreach \X in {1,...,6}
 {\begin{scope}[tdplot_main_coords]
\draw[dashed] (\X,0,-1.5) coordinate (b\X) -- (\X,0,0) coordinate (c\X);
 \begin{scope}[canvas is xy plane at z=0]
  \draw (c\X) circle[radius=3mm];
  \path ($(c\X)+(-\X*60+60:0.3)$) coordinate (t\X);
 \end{scope}
\end{scope} 
\draw (c\X|-0,-2.5) circle[radius=3mm];
 \ifodd\X
  \draw[-stealth] (t\X) -- (b\X);
  \draw[-stealth] (c\X|-0,-2.5) -- ++ (-\X*60+60:0.3) coordinate(p\X);
 \else
  \draw[stealth-] (t\X) -- (b\X);
  \draw[stealth-] (c\X|-0,-2.5) -- ++ (-\X*60+60:0.3)  coordinate(p\X);
 \fi
}
\draw plot[smooth,samples at={1,...,6}] (p\x);
\end{tikzpicture}
\end{document}

在此处输入图片描述

或者使用一些 pgf 键。

\documentclass[tikz,border=3mm]{standalone}
\usepackage{tikz-3dplot}
\begin{document}
\tdplotsetmaincoords{70}{0}
\begin{tikzpicture}[clock/.cd,distance/.initial=2,radius/.initial=0.7,
angle increment/.initial=50]
\foreach \X in {1,...,6}
 {\begin{scope}[tdplot_main_coords]
\draw[dashed] (\pgfkeysvalueof{/tikz/clock/distance}*\X,0,-1.5) coordinate (b\X)
  -- (\pgfkeysvalueof{/tikz/clock/distance}*\X,0,0) coordinate (c\X);
 \begin{scope}[canvas is xy plane at z=0]
  \draw (c\X) circle[radius=\pgfkeysvalueof{/tikz/clock/radius}];
  \path ($(c\X)+({-(\X-1)*\pgfkeysvalueof{/tikz/clock/angle increment}}:\pgfkeysvalueof{/tikz/clock/radius})$) coordinate (t\X);
 \end{scope}
\end{scope} 
\draw (c\X|-0,-2.5) circle[radius=\pgfkeysvalueof{/tikz/clock/radius}];
 \ifodd\X
  \draw[-stealth] (t\X) -- (b\X);
  \draw[stealth-] (c\X|-0,-2.5) -- ++ ({-(\X-1)*\pgfkeysvalueof{/tikz/clock/angle increment}}:\pgfkeysvalueof{/tikz/clock/radius}) coordinate(p\X);
 \else
  \draw[stealth-] (t\X) -- (b\X);
  \draw[-stealth] (c\X|-0,-2.5) -- ++ ({-(\X-1)*\pgfkeysvalueof{/tikz/clock/angle increment}}:\pgfkeysvalueof{/tikz/clock/radius})  coordinate(p\X);
 \fi
}
\draw plot[smooth,samples at={1,...,6}] (p\x);
\end{tikzpicture}
\end{document}

在此处输入图片描述

相关内容