请问一下各位大佬,能给一个画正四面体的例子么?我找了一个画立方体的,可是按照着修改,很多错误。

2020-03-28 12:36发布

% !Mode:: TeX:UTF-8%確保文檔utf-8編碼\documentclass[tikz,border=2pt]{standalone} \begin{document}\begin{ti...

% !Mode:: “TeX:UTF-8”%確保文檔utf-8編碼
\documentclass[tikz,border=2pt]{standalone}

\begin{document}
\begin{tikzpicture}
%draw the axes
\draw[->] (0,0,0) — (3,0,0) node[anchor=west]{$x$};
\draw[->] (0,0,0) — (0,3,0) node[anchor=west]{$y$};
\draw[->] (0,0,0) — (0,0,3) node[anchor=west]{$z$};
%draw the top and bottom of the cube
\draw (0,0,0) — (0,2,0) — (2,2,0) — (2,0,0) — cycle;
\draw[] (0,0,2) — (0,2,2) — (2,2,2) — (2,0,2) — cycle;
%draw the edges of the cube
\draw[] (0,0,0) — (0,0,2);
\draw[] (0,2,0) — (0,2,2);
\draw[] (2,0,0) — (2,0,2);
\draw (2,2,0) — (2,2,2);
\end{tikzpicture}
\end{tikzpicture}

\end{document}