<s>[INST] Regular Tetrahedron rotation problem Say that I have a regular tetrahedron with vertices $a$, $b$, $c$ and $d$ where $a$, $b$ and $c$ sit on a plane. The height of $d$, above the plane, is trivial to obtain given the length of any edge.
If I were now to re-orient the tetrahedron such that vertex $a$ remains in contact with the plane but $b$ and $c$ are raised from it, how can I now obtain the height of $d$ above the plane, given the elevations of $b$ and $c$?
Presumably this is relatively trivial, but it is outside my area of expertise.
One thing to note is that I need to be able calculate the final algorithm fairly quickly in real time using the 'C' language on a fairly low power processor. 
 [/INST] Suppose an edge of the tetrahedron has length $1$, and let the heights of $b$ and $c$ after elevation be $j$ and $k$, respectively.
Place vertex $a$ at the origin of a system of coordinates. Let vertex $b$ be located in the $xz$-plane, so its coordinates, after elevation, are $(\sqrt{1-j^2},0,j)$. We can find the coordinates of $c$ by specifying that it is $1$ unit away from $a$ and from $b$, and $k$ units above the $xy$-plane.
$x^2+y^2+z^2=1$
$(x-\sqrt{1-j^2})^2 + y^2 + (z-j)^2 = 1$
$z=k$
Solving these equations, we get the coordinates of $c$ as $\left(\sqrt{\frac{1-4jk(1-jk)}{4(1-j^2)}},\sqrt{\frac{3-4(j^2+k^2-jk)}{4(1-j^2)}},k\right)$. As a reality-check, note that when $j=k=0$, these expressions reduce to the appropriate numbers.
Finally, the vertex $d$ is at the intersection of the three spheres centered at $a$, $b$ and $c$, each with radius $1$.
$x^2 + y^2 + z^2 = 1$
$\left(x-\sqrt{1-j^2}\right)^2 + y^2 + (z-j)^2 = 1$
$\left(x-\sqrt{\frac{1-4jk(1-jk)}{4(1-j^2)}}\right)^2 + \left(y-\sqrt{\frac{3-4(j^2+k^2-jk)}{4(1-j^2)}}\right)^2 + (z-k)^2 = 1$
The height you're looking for is the $z$-coordinate of the intersection of those three spheres. The top equation can be solved for $y$: $y=\sqrt{1-x^2-z^2}$, and that can be substituted into the other two. Then the second equation can be solved for $x$, resulting in $x=\frac{1-2jz}{2\sqrt{1-j^2}}$. Finally, this can be plugged into the third equation, resulting in a horrific mess, which is nevertheless, after some simplifying, a quadratic equation in $z$.
Indeed:
$$\frac{2j\sqrt{A}\sqrt{1-j^2}+j-2k(1-j^2)}{1-j^2}z+A+\frac{\sqrt{A}}{\sqrt{1-j^2}}+k^2=2\sqrt{B}\sqrt{C(z)}$$,
where $A=\frac{1-4jk(1-jk)}{4(1-j^2)}$, $B=\frac{3-4(j^2+k^2-jk)}{4(1-j^2)}$, and $C(z)=1-z^2-\frac{1-4jz+4j^2z^2}{4(1-j^2)}$
If you square both sides of this, it's quadratic in $z$. Unfortunately, I have to stop here. If you have specific values for $j$ and $k$, you can plug them in, and then it won't be so bad.
</s>