How to draw a simple cone with height and radius with TikZ?
In the above thread, a cone was created. However, if I invert the cone, the lines from the origin to the cone edges cuts through the cone. This is not visually pleasing. How can I get the line to only intersect the (\pm 2, 3) without going through ellipse opening?
\documentclass[tikz]{standalone}
\usetikzlibrary{calc}
\usetikzlibrary{intersections}
\usetikzlibrary{shadings}
\begin{document}
\begin{tikzpicture}
\coordinate (h) at (0, 3);
\coordinate (O) at (0, 0);
\draw (O) -- +(0, 4);
\draw (O) -- +(3, 0);
\draw (O) -- +(-3, 0);
\fill[
top color = gray!50,
bottom color = gray!10,
shading = axis,
opacity = 0.25
]
(h) ellipse[x radius = 2, y radius = 0.5];
\fill[
left color = gray!50!black,
right color = gray!50!black,
middle color = gray!50,
shading = axis,
opacity = 0.25
]
(2, 3) -- (O) -- (-2, 3) arc[x radius = 2, y radius = .5, start angle = 180,
end angle = 360];
\draw (-2, 3) arc[x radius = 2, y radius = .5, start angle = 180,
end angle = 360] -- (O) -- cycle;
\draw[dashed] (-2, 3) arc[x radius = 2, y radius = .5, start angle = 180,
end angle = 0];
\end{tikzpicture}
\end{document}





