Let be four point
0,0,a) coordinate (A')
(a,0,0) coordinate (B)
(0,a,0) coordinate (D)
(a,a,a) coordinate (C')


I am trying to draw a cone with vertex at A' and circle of base is BDC. I tried


\documentclass[tikz,border=3mm]{standalone}
\usetikzlibrary{calc,3dtools}% https://github.com/marmotghost/tikz-3dtools
\begin{document}
\begin{tikzpicture}[3d/install view={phi=70,theta=65,psi=20},
line cap=round,line join=round,
declare function={a=4;}]
\path (0,0,a) coordinate (A')
(a,0,0) coordinate (B)
(0,a,0) coordinate (D)
(a,a,a) coordinate (C');
\path[3d/circumcircle center={A={(D)},B={(B)},C={(C')}}] coordinate (G);
\pgfmathsetmacro{\R}{sqrt(TD("(G)-(B)o(G)-(B)"))} ;
\pgfmathsetmacro{\h}{sqrt(TD("(G)-(A')o(G)-(A')"))} ;
\path[overlay,3d coordinate={(n)=(B)-(C')x(B)-(D)}];
\pic{3d/circle on sphere={R=\R,C={(G)},P={(G)},n={(n)}}};
%\path (a,2*a/3,a/3) coordinate (T) pic{3d/cone={r=\R,h/.evaluated=\h}};
\foreach \p in {A',B,C',D,G}
{\draw[fill=black] (\p) circle (1.2 pt);}
\foreach \p/\g in {G/-90,A'/-90,B/-90,C'/-90,D/90}
{\path (\p)+(\g:3mm) node{$\p$};}
\end{tikzpicture}
\end{document}

![ScreenHunter 81.png](/image?hash=b9f7d28a960e80cd905d6f484f00db700c54bba4f22b2bbd3019627b829717b8)

How can I draw the cone? And can I put the cone inot a cube like this?

![ScreenHunter 80.png](/image?hash=49ec781a70f1943400277c9e9fd3d249844db04b4cb8199ab65e912ba3478f58)
Top Answer
I can currently only answer the first part of the question. It is as simple as finding an appropriate coordinate system, in which the z-axis points into the direction of axis of the cone.

\documentclass[tikz,border=3mm]{standalone}
\usetikzlibrary{calc,3dtools}% https://github.com/marmotghost/tikz-3dtools
\begin{document}
\foreach \Angle in {5,15,...,355}
{\begin{tikzpicture}[3d/install view={phi=\Angle,theta=65,psi=20},
line cap=round,line join=round,same bounding box=A,
declare function={a=4;}]
\path (0,0,a) coordinate (A')
(a,0,0) coordinate (B)
(0,a,0) coordinate (D)
(a,a,a) coordinate (C');
\path[3d/circumcircle center={A={(D)},B={(B)},C={(C')}}] coordinate (G);
\pgfmathsetmacro{\R}{sqrt(TD("(G)-(B)o(G)-(B)"))}
\pgfmathsetmacro{\h}{sqrt(TD("(G)-(A')o(G)-(A')"))}
\tikzset{3d/define orthonormal dreibein={A={(D)},B={(B)},C={(C')}}}
\path[x={(ex)},y={(ey)},z={(ez)}]
(G) pic{3d/cone={r=\R,h=\h}};
\foreach \p/\g in {G/-90,A'/-90,B/-90,C'/-90,D/90}
{\draw[fill=black] (\p) circle[radius=1.2pt]+(\g:3mm) node{$\p$};}
\end{tikzpicture}}
\end{document}

![ani.gif](/image?hash=7860aa64f0b42b8f1f1d3929496b0227264b2f7600bf9d9a5601cab843927b28)

The second part is much harder. One would have to compute a number of intersections. It would be even harder to make this fully rotatable.

This room is for discussion about this question.

Once logged in you can direct comments to any contributor here.

Enter question or answer id or url (and optionally further answer ids/urls from the same question) from

Separate each id/url with a space. No need to list your own answers; they will be imported automatically.