动画叉积?

动画叉积?

我怎样才能使用乳胶制作这个动画? 在此处输入图片描述

答案1

所以这是一个起点,我认为它包含了你进步所需的一切。如果你不知道如何做某件事,你可以提出一个新问题,但如果只是对我提供的代码有疑问,你可以发表评论。

有一个小瑕疵,即绘图在某一帧中“移动”,但我不确定是什么原因造成的。一旦我了解发生了什么,就会修复它。

输出

在此处输入图片描述

代码

\documentclass[tikz, margin=10pt]{standalone}
\usepackage{tikz-3dplot}
\usetikzlibrary{arrows.meta}

\newcommand\basicstuff{
    \path (0,0,0) -- (0,0,\dirz.5);
    \path (0,0,0) -- (0,0,-\dirz.5);
}
\newcommand\dd{
    \textcolor{gray}{\|}
}

\begin{document}

\pgfmathsetmacro\dirx{3}
\pgfmathsetmacro\diry{3}
\pgfmathsetmacro\dirz{3}
\tdplotsetmaincoords{70}{30}
\foreach \angle [
    evaluate=\angle as \zz using (\angle/30),
    evaluate=\angle as \opac using (\angle/50),
    ] in {0,5,...,90}{
\begin{tikzpicture}[tdplot_main_coords]
\basicstuff

\begin{scope}[opacity=\opac]
\filldraw[draw=orange, fill=orange!30] (0,0,.5) --++ (\angle:.5) --++ (0,0,-.5) -- (0,0,0) -- cycle;
\filldraw[draw=orange, fill=orange!30] (0,0,.5) --++ (0:.5) --++ (0,0,-.5) -- (0,0,0) -- cycle;
\end{scope}

\draw[thick, blue,-{Latex}] (0,0,0) -- (0:\dirx);
\draw[thick, red, -{Latex}] (0,0,0) -- (\angle:\diry);
\ifnum\angle>5
\draw[thick, violet, -{Latex}] (0,0,0) -- (0,0,\zz);
\else\fi
\draw (0,0,0) ellipse (3cm and 1cm);

\fill (0,0,0) circle (2pt);
\end{tikzpicture}
}
%
\foreach \x [evaluate=\x as \opac using (\x/10)] in {0,...,10,10,10,10,10,10}{
\begin{tikzpicture}[tdplot_main_coords]
\basicstuff

\filldraw[draw=orange, fill=orange!30] (0,0,.5) --++ (90:.5) --++ (0,0,-.5) -- (0,0,0) -- cycle;
\filldraw[draw=orange, fill=orange!30] (0,0,.5) --++ (0:.5) --++ (0,0,-.5) -- (0,0,0) -- cycle;

\draw[thick, blue,-{Latex}] (0,0,0) -- (0:\dirx);
\draw[thick, red, -{Latex}] (0,0,0) -- (90:\diry);
\draw[thick, violet, -{Latex}] (0,0,0) -- (0,0,\dirz);
\draw (0,0,0) ellipse (3cm and 1cm);

\begin{scope}[opacity=\opac]
\node[below,text width=4.5cm, font=\Large\bfseries, text centered, anchor=north] at (0,0,-1.5) {
    $\textcolor{blue}{a} \textcolor{orange}{\perp} \textcolor{red}{b}$\\
    $\dd \textcolor{violet}{a \times b} \dd = \dd\textcolor{blue}{a}\dd \dd\textcolor{red}{b}\dd$
    };
\end{scope}

\fill (0,0,0) circle (2pt);
\end{tikzpicture}
}
\end{document}

相关内容