The frustum equations; how much can you tilt a frustum? 
"Mathematicians are machines for turning coffee into theorems".
  -Paul Erdòs

I'm pretty sure almost everyone reading this has drunk a cup of coffee before. If you get coffee from Starbucks or Dunkin' Donuts, it comes in a brown cylindrical frustum cup full of the delicious good stuff to keep you up as you work on typing the answer to that one Calculus problem that has stumped everyone else. A few days ago I was cleaning up after I spilled a cup of Joe and wondered, 'is there a formula to the limit of tipping a coffee (or otherwise frustum shaped) cup?' It seems likely, since there is a formula for doing the same thing with a cylinder. 
(For those of you who are confused, a frustum is a cylinder that has one of its circles larger than the other, and all parallel cross sections line up on a line perpendicular to the base)
I may not be experienced with Calculus, but I do know all the Trigonometry stuff, and using it and simple math, I deduced that if a=radius of cylindrical cup, and $h_1$=height of the cup, and $h_2$=height of liquid, then the maximum angle you can tip the cup, assuming $0$ surface friction, is 
$$\sin^{-1}
\frac{\sqrt{a+(h_1-h_2)}}
{2(h_1-h_2)}
$$
I think, anyway. But frustums are much harder. Considering all the variables are the same, and $a_1$ is the radius of the top of the frustum and $a_2$ is the smaller base, the one issue I have is, should I calculate the radius $a_3$ which would be the average, or the average radius of the area directly between $h_1$ or $h_2$. I've tried a lot over the last few days, and they are all flawed. 
So, just to recap, if the top and bottom of the frustum cup are $a_1$ and $a_2$ respectively, $h_1$ is the height of the cup, and $h_2$ is the height of the liquid in the cup, then what is the formula for how much you can tilt it before the coffee spills out? Or am I providing insufficient information? Thanks in advance.
 A: In diagram below I reproduced a section of the given frustum, with $HA=a_1$, $KC=a_2$, $HK=h_1$ and $MK=h_2=$ height of liquid when the cup is not tilted. We can extend the frustum to a full cone of vertex $V$ and set $VK=h$ and $\theta=\angle CVK$. Some easy geometry gives then $h=a_2h_1/(a_2-a_1)$ and $\tan\theta=a_2/h$.
If the cup is tilted to the limit point, the surface of the liquid is $AE$ and the tilt angle is $\alpha$. I will deal here only with the case when the frustum base is completely covered by the liquid, that is when
$$
h_2\ge{h_1\over1+\sqrt{a_1/a_2}}.
$$
In this case we can then apply the result given in this answer to a similar question:
$$
EV\cdot AV = LV^2.
$$
By applying then the sine rule to triangle $VAE$ we get after some algebra:
$$
\tan\alpha=\cot\theta\,{AV^2-LV^2\over AV^2+LV^2}.
$$
It is now only a matter of expressing $AV$ and $LV$ in terms of our data:
$$
AV={h_1+h\over\cos\theta},\quad LV={h_2+h\over\cos\theta}
$$
and then
$$
\tan\alpha=
{h\over a_2}{(h_1-h_2)(h_1+h_2+2h)\over h_1^2+h_2^2+2h^2+2(h_1+h_2)h}
={h_1(h_1-h_2)\big(a_2(h_1-h_2)+a_1(h_1+h_2)\big)
\over h_1^2(a_1^2+a_2^2)+2h_1h_2a_2(a_1-a_2)+h_2^2(a_1-a_2)^2}.
$$
In particular, letting $a_2=a_1=a$ we recover the analogous formula for a cylinder:
$$
\tan\alpha={h_1-h_2\over a}.
$$

A: The coffee cup tips when $\bar z \sin \theta > b$

We just need a formula for $\bar z$
Center of mass
$\bar z = \frac {\pi\int_0^h z y^2(z) dz}{\pi\int_0^h y(z) dx}$
$y(z) = \frac {b-a}{h} z + b$
$\int_0^h (\frac {b -a}{h}z + b)^2 dz\\
(\frac {(b-a)^2}{3} + \frac {2(b-a)b}{2} + b^2) h$
$\int_0^h z(\frac {b -a}{h} z + b)^2 dz\\
(\frac {(b-a)^2}{4} + \frac {2(b-a)b}{3} + \frac {b^2}{2}) h^2$
$\bar z = \frac {3(b-a)^2 + 8(b-a)b + 6b^2}{4(b-a)^2 + 12(b-a)b+ 12 b^2} h$
