A cocktail glass is typically filled with 130 milliliters of liquid. My cocktail glass has a diameter of 115 millimeters. If I stick a needle in the middle of my filled cocktail glass, the booze would reach a height of 37.55 millimeters (ignoring the volume of the needle completely).
If I take another, identical cocktail glass, but only pour 50 milliliters of liquid in it, how deep would it be this time if I would put a needle in to measure?
Context:
I'm building a cocktail recipe website, and I'd like to make a visualization of the liquids in a cocktail glass. I list the ingredients in various milliliters, and I'd like a 2D cocktail glass to show the layers and their proportionate area in the triangle.
The reason I need to base the calculation on a cone rather than a triangle is because I want to give the visitor the ability to modify the default glass size (different radius, different depth, etc).
I will use the calculated height from the formula to fill a piece of the triangle for each ingredient based on their volume of the recipe.
Cocktail glasses aren't exactly cones; they're more like frustums, aka truncated cones. Now, since the glass is a frustum, the liquid will be in that shape too. The formula for the volume is: $$V =\frac{1}{3}\pi h(b^2 + bt + t^2)$$ Where:
$V$ is the volume of the liquid.
$h$ is the height of the liquid.
$t$ is the radius of the top of the liquid ($R_1$ in the link above).
$b$ is the radius of the bottom of the liquid ($R_2$ in the link).
Rearranging, we get: $$h = \frac{3V}{\pi (b^2 + bt + t^2)}$$ So, if we have the volume of the liquid, the radius of the top of the glass, and the radius of the bottom of the glass, we can find the height.
Using your measurements, we have $V = 50$ and $t = 115/2 = 57.5$ (we divided by 2 to get the radius.) You didn't specify the radius of the bottom of the glass, but I'll take it to be around 15 mm. If you want to be extra accurate, just measure it and replace the value.
If we calculate the height using the formula, we get: $$h = \frac{3 \times 50 \times 1000}{\pi \times (225 + 862.5 + 3306.25)} = 10.867 mm$$ Notice that I multiplied by 1000 in the numerator to convert the volume from milliliters to cubic millimeters (since $1 ml = 1000 mm^3$). It is important to do that since the rest of the values are in millimeters.
Finally, I just want to mention that we have a small problem; usually cocktail glasses aren't filled to the very brim, and so the top radius $t$ of the liquid will be less than that of the actual glass. If for the most part the liquid is close to the brim you can just assume it is and ignore it but if the liquid amount is significantly less than the glass' volume you'll need to find a way to get the value. The first thing that comes to mind is to use similar triangles in the glass and the liquid but you'll need another value or two (specifically the slant height of the whole glass and the liquid).