I am trying to learn to use the \newcommand feature to produce frustums of different sizes, possibly with dotted lines making the frustum to a cone.
This line of code does not work -- clearly a problem with the arithmetic using the parameters -- I have been testing with an alternative and it appears to be the division that is causing the problem.
%\draw[semithick] (-#3,#1) ellipse ( (#2)*(#3)/((#1)+(#2) ) and (#2)*(#3)/(3*( (#1)+(#2) ) ) );%
My code is below
\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{calc}
\usepackage{amssymb}
\usetikzlibrary{math}
\newcommand{\Frustom}[3]{
\begin{tikzpicture}
\draw[dashed,color=gray] (0,0) arc (2:178:#3 and #3/5);
\draw[semithick] (-2*#3,0) -- (-#3,#1+#2);
\draw[semithick] (0,0) -- (-#3,#1+#2);
\draw[semithick] (0,0) arc (0:-180:#3 and #3/5);
%\draw[semithick] (-#3,#1) ellipse ( (#2)*(#3)/((#1)+(#2) ) and (#2)*(#3)/(3*( (#1)+(#2) ) ) );% right ellipse
\draw[semithick] (-#3,#1) ellipse ( #2*#3/9 and 12/27 ) ;
\end{tikzpicture}
} %
\begin{document}
\Frustom{6}{3}{4} %frustum height, cone height, base radius
\end{document}
