Align the center of a unit cube to the origin, and one of its long diagonals to the z-axis. In terms of r and h, what proportion of the circle {x^2 + y^2 = r^2, z = h} is inside the cube?
1 Answer
Disclaimer: I did the below without any technical aid. While I'm confident the general geometry is sound, there may be bugs in the formulas.
Let $H=\sqrt[3]{2}/2$ such that the planes $z = \pm H$ touch the tips of the cube. From $H$ to $H/3$ and from $-H$ to $-H/3$ the cross section with a horizontal plane is a (solid) regular triangle whose side $a_\pm$ grows linearly from $0$ to $\sqrt 2$. Between $-H/3$ and $H/3$ the cross section is a cyclic hexagon with 3fold symmetry, i.e. side lengths $a_+a_-a_+a_-a_+a_-$ where $a_+$ grows linearly from $0$ to $\sqrt 2$ while $a_-$ shrinks linearly from $\sqrt 2$ to $0$. The distance of the sides $a_\pm$ from the $z$ axis grows linearly from $0$ to $\sqrt{2/3}$ with $z$ between $\pm H$ and $\mp H/3$. The slope $s$ is therefore $\sqrt[6]2\sqrt 3/2$. And we find that if $-H\le h\le H$ and the ratios $R_\pm = \frac r{H\mp h}$
- are both $\le s$ then the circle is completely inside
- if at least one of them is $>2s$ then the circle is completely outside
- otherwise determine the angles $\phi_\pm = \arccos (s /R_\pm)$
--- if $h<-H/3$ then the fraction outside is $3\phi_-/\pi $ and if $h>H/3$ it is $3\phi_+/\pi$
--- otherwise the fraction outside is $\min (\frac{3(\phi_-+\phi_+)}{\pi},1)$