0

I need to draw the following tetrahedron using tikz/pgf ?

enter image description here

I need to place the two vertices Given by AC) of the triangular base on x-axis and y-axis while the other on xyz-space and the top vertex V as usual in xyz-space as shown in the figure. I need to fill with different colors on the visible faces.

I am trying the following code but it is not that good as shown in the following figure, no x-axis, y-axis, z-axis are plotted.

\documentclass[12 pt]{amsart}
\usepackage{tikz}
\usepackage{tikz-3dplot}
\begin{document}
\begin{tikzpicture}
        \path (4,5,1) coordinate (V)
        (3,2,1)  coordinate (B)
        (0,1,0)  coordinate (C)
        (3,0,0)  coordinate (A);
        \draw[thick,fill=cyan] (A) -- (C) -- (V) -- cycle;
        \draw[thick,fill=black] (A) -- (B)  -- (C) -- cycle;
        \draw[thick,fill=blue] (B) -- (C)  -- (V) -- cycle;
        \end{tikzpicture}
\end{document}

enter image description here

Please help to draw the above tetrahedron

1 Answer 1

4

You can try this code.

\documentclass[12 pt]{standalone}
\usepackage{tikz}
\usepackage{tikz-3dplot}
\begin{document}
\tdplotsetmaincoords{60}{80}
\begin{tikzpicture}[tdplot_main_coords,line join=round]
\path (3,2,5) coordinate (V)
(2,2,0)  coordinate (B)
(0,2,0)  coordinate (C)
(3,0,0)  coordinate (A);
\draw[thick,fill=cyan] (A) -- (C) -- (V) -- cycle;
\draw[thick,fill=blue] (A) -- (B)  -- (C) -- cycle;
\draw[thick,fill=gray] (B) -- (C)  -- (V) -- cycle;
\foreach \p in {A,B,C,V}
\draw[fill=black] (\p) circle (1pt);
\foreach \p/\g in {V/45,A/135,B/-90, C/150}
\path (\p)+(\g:3mm) node{$\p$};
\end{tikzpicture}
\end{document}

enter image description here

I change coordinates of vertices to get another picture. I hope, you understand this.

\documentclass[12 pt]{standalone}
\usepackage{tikz}
\usepackage{tikz-3dplot}
\begin{document}
\tdplotsetmaincoords{60}{60}
\begin{tikzpicture}[tdplot_main_coords,line join=round]
\path (0,0,4) coordinate (V)
(0,0,0)  coordinate (A)
(3,0,0)  coordinate (C)
(0,3,0)  coordinate (B);
\draw[thick,fill=cyan] (A) -- (C) -- (V) -- cycle;
\draw[thick,fill=blue] (A) -- (B)  -- (C) -- cycle;
\draw[thick,fill=gray] (B) -- (C)  -- (V) -- cycle;
\foreach \p in {A,B,C,V}
\draw[fill=black] (\p) circle (1pt);
\foreach \p/\g in {V/45,A/135,B/90, C/-90}
\path (\p)+(\g:3mm) node{$\p$};
\draw[thick,->] (A) -- (5,0,0) node[left]{$x$};
\draw[thick,->] (A) -- (0,5,0) node[left]{$y$};
\draw[thick,->] (A) -- (0,0,5) node[left]{$z$};
\end{tikzpicture}
\end{document}

enter image description here

3
  • Thanks. But how to display x-axis, y-axis, z-axis and show that A and C or A and B lie on x-axis and y-axis respectively ?
    – learner
    Commented Oct 15, 2020 at 13:09
  • it is nice but i want to place the 3rd coordinate say, A, away from origin. For example how to place A at (2,1,2) ? Second, I don't understand the function of \tdplotsetmaincoords{60}{60}
    – learner
    Commented Oct 15, 2020 at 14:46
  • @M.A.SARKAR Please see manual of tikz-3dplot. Commented Oct 16, 2020 at 6:17

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .