Parallelepiped size with sphere inscribed

geometryspheres

I have found a similar question, but it remained unanswered, thus I copy it here with my further questions.

Inscribing a sphere in a parallelepiped

Definition of angles $\alpha$, $\beta$ and $\gamma$ is the same as in the other question. What I need is to find a size of the parallelepiped of given (fixed) angles $\alpha$, $\beta$ and $\gamma$ (I believe these do not need to be equal) given the inscribed sphere of radius $r$. If only one angle is not right this is trivial: assume $\alpha = \beta = 0$ and $\gamma \neq 0$; this gives four edges $=r$ and other equal to $r/\sin(\gamma/2)$. But with three different angles I have severe difficulties. With many thanks in advance how to approach the problem.

Best Answer

The parallelepiped is given by three vectors $\vec{a} = l_a \hat{a}$, $\vec{b} = l_b \hat{b}$, and $\vec{c} = l_c \hat{c}$ whose lengths $l_a$, $l_b$, and $l_c$ are unknown. The parallelepiped is bounded by 6 planes \begin{align} p_1 &= \lambda \vec{b} + \delta \vec{c} \\ p_2 &= \vec{a} + \lambda \vec{b} + \delta \vec{c} \\ p_3 &= \lambda \vec{a} + \delta \vec{c} \\ p_4 &= \vec{b} + \lambda \vec{a} + \delta \vec{c} \\ p_5 &= \lambda \vec{a} + \delta \vec{b} \\ p_6 &= \vec{c} + \lambda \vec{a} + \delta \vec{b} \\ \end{align} where $\lambda,\delta \in[0,1]$. To ensure that a sphere is inscribed in the parallelepiped, the shortest distance from the origin to any plane has to be greater than or equal to the radius of the sphere $r$. For example, the unit vector $n_2$ orthogonal to $p_2$ is \begin{equation} \hat{n}_2 = \frac{\hat{b} \times \hat{c}}{||\hat{b} \times \hat{c}||}, \\ \end{equation} the shortest distance to $p_2$ is $|\vec{a}\cdot\hat{n}_2| = r$, from which we find one edge length of the parallelepiped is \begin{align} l_a &= \left| \frac{r \sqrt{(b_y c_x - b_x c_y)^2 + (b_z c_x - b_x c_z)^2 + (b_z c_y - b_y c_z)^2}}{(a_z b_y c_x - a_y b_z c_x - a_z b_x c_y + a_x b_z c_y + a_y b_x c_z - a_x b_y c_z))} \right|. \end{align} Similar expressions for $l_b$ and $l_c$ are obtained by permuting $\{a,b,c\}$ in the expression for $l_a$.