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

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}

4条回答
zhaochongbin
2020-03-28 16:17
正四面体你先自己把4个点的空间坐标先建模出来吧,然后像你的例子一样把各点连起来就好了。 By the way, 用球坐标或者柱坐标建模都会比直角坐标方便。

一周热门 更多>