# When a Cube Loves a Circle [closed]

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?

• Why is this question off-topic?
– qwr
Oct 3, 2021 at 2:25

Let $$H=\sqrt{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 $$\sqrt2\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)$$