I can generate a cone with a circular base but I have no idea as to how to mark another cone within it. The end result I am aiming for looks like the following image.

enter image description here

  • This is a math problem. draw big cone first then draw small circle with center at half of height. – user108724 Feb 15 at 9:33
\draw(0,0) circle (2cm and 0.5cm);
\draw(2,0) -- (0,6) -- (-2,0) arc (180:360:2cm and 0.5cm);
\draw(-2,0) arc (180:360:2cm and 0.5cm) -- (0,6) -- cycle;
\draw[dashed](-2,0) arc (180:0:2cm and 0.5cm);
\draw[dashed](2,0) -- node[below] {$2r$} (0,0); 
\draw(-1,3)arc (180:360:1cm and 0.25cm);
\draw[dashed](-1,3)arc (180:0:1cm and 0.25cm);
\draw[dashed](1,3) -- node[below=-2pt] {$r$} (0,3) ;

\draw[|-|] (-2.5,6) -- (-2.5,0) node[left,pos=.5]{$2h$};
\draw[|-|] (2.5,6) -- (2.5,3) node[right,pos=.5]{$h$};

enter image description here

| improve this answer | |
  • The logic of your code is neat. Thank you for your help. – Sam Feb 17 at 18:40

You can use tikz-3dplot. In this code, you can change the value of x of the line \pgfmathsetmacro\myx{\h/2}. In your case, myx = h/2.

    \pgfmathsetmacro\R{3*\a} %radius of base 
    \pgfmathsetmacro\h{5*\a} %hight of cone 
    \begin{tikzpicture} [tdplot_main_coords,line join = round, line cap = round] 
    (0,0,0) coordinate (O)
     (0,0,\h) coordinate (S)
    (0,0,\myx) coordinate (O');
    \draw[dashed] (O) -- (O') node[right, midway]{$x$};
    \draw[dashed] (S) -- (O') node[sloped,midway,auto=left]{$h-x$}; 
    \begin{scope}[canvas is xy plane at z=\myx]
    \tdplotdrawarc[thick]{(O')}{\myr}{\PhiOne}{360+\PhiTwo}{anchor=north}{}     \tdplotdrawarc[dashed]{(O')}{\myr}{\PhiTwo}{\PhiOne}{anchor=north}{}
    \draw[dashed] (O') --(\myr*\cosPhiTwo,\myr*\sinPhiTwo,0) node[midway, below] {$ r $}; 

        \tdplotdrawarc[thick]{(O)}{\R}{\PhiOne}{360+\PhiTwo}{anchor=north}{}    \tdplotdrawarc[dashed]{(O)}{\R}{\PhiTwo}{\PhiOne}{anchor=north}{}
     \draw[thick] (S) -- (\R*\cosPhiOne,\R*\sinPhiOne,0); 
    \draw[thick] (S) -- (\R*\cosPhiTwo,\R*\sinPhiTwo,0); 
    \draw[dashed] (O) --(\R*\cosPhiTwo,\R*\sinPhiTwo,0) node[midway, below] {$ R = 2r $};
    \foreach \p in {S,O,O'}
    \draw[fill=black] (\p) circle (1.5pt);
    \foreach \p/\g in {S/90,O/-90,O'/180}
    \path (\p)+(\g:3mm) node{$\p$};

enter image description here

With \pgfmathsetmacro\myx{\h/5}, we have

enter image description here

| improve this answer | |

If you want a correct cone in 3d you can read this Mathematics_in_Science_Teaching

The code is from Aslanbek Naziev (Ryazan State University). I adapted the code to v3.02


 \tkzDefTangent[from = T](O_1,R)
 \tkzDefPointBy[symmetry=center O_1](t_1)
 \tkzDrawSegments[dashed](t_1,t_3 T,O_1 C,D)
 \tkzDrawSegments(T,t_1 T,t_2 T,t_3)
 \tkzLabelPoints[above right](O_1) 
 \tkzInterLC[R](X1,Y1)(C',5 cm) 
 \tkzDefTangent[from = T'](I,O_1') 
 \tkzDefLine[parallel=through J](X,Y) 
 \tkzDefLine[parallel=through I](X,Y) 
 \tkzDefLine[parallel=through G](X,Y) 
 \tkzDefTangent[from = T](O_2,C_1) 
 \tkzInterLC[R](T',O_1')(I,\rIN pt) 
 \tkzDefLine[parallel=through N'](X,Y) 

enter image description here

| improve this answer | |
  • Hi, how do we read this file (Mathematics_in_Science_Teaching)? This link leads to a page that asks you to choose a file type RIS, BibTeX, etc. – AndréC Feb 15 at 12:13
  • @AndréC I changed the link ! but I have no trouble reading the old link. – Alain Matthes Feb 15 at 12:29

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.