what is the ratio of the volumes of a sphere and a cone with the base diameter and the altitude of the cone equal to the diameter of the sphere?

what is the ratio of the volumes of a sphere and a cone with the base diameter and the altitude of the cone equal to the diameter of the sphere?
we know that $2r=D \iff r=\frac{D}{2}$

using this we get...

$V_s=\frac{4}{3}\pi r^3=\frac{4\pi}{3}\left( \frac{D}{2}\right)^3=\frac{\pi D^3}{6}$

Now for the cone we know that $h=D$

$V_c=\frac{1}{3}\pi r^2h=\frac{\pi}{3}\left( \frac{D}{2}\right)^2D=\frac{\pi D^3}{12}$

So the ratio is

$\frac{V_s}{V_c}=\frac{\frac{\pi D^3}{6}}{\frac{\pi D^3}{12}}=2$

3. Volume of a sphere: $\frac{4}{3}\pi r^3$
Volume of a cone: $\frac{1}{3}\pi r^2 h = \frac{1}{3}\pi r^2 2r = \frac{2}{3} \pi r^3$

Where $h = 2r$ is the height of the cone (altitude) and where $r$ is the radius of the base of the cone and the radius of the sphere (they are equal since we are given that the diameter of the base of the cone and that of the sphere are equal).

So the ratio is: $\frac{\frac{4}{3}\pi r^3}{\frac{2}{3} \pi r^3} = 2$