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. 
 A: Choose coordinates with the origin at the center of the tetrahedron, and let $a_1,a_2,a_3,a_4\in\mathbb R^3$ be the vertices. Note that $\sum_ia_i=0$. By symmetry
$$
  a_i\cdot a_j=\begin{cases}
    \lambda&\text{if }i=j,\\
    \mu&\text{if }i\neq j
  \end{cases}
$$
for some $\lambda,\mu$. Choose the scale so that $\lambda=1$ (this means the side lengths are $\sqrt{8/3}$). Then
$$
  0=a_1\cdot\sum_i a_i=\lambda+3\mu
$$
so $\mu=-1/3$. Also
$$\begin{eqnarray*}
  a_j^T\left(\sum_i a_ia_i^T\right)a_k
    &=&\sum_i(a_i\cdot a_j)(a_i\cdot a_k)\\
    &=&\begin{cases}4/3&\text{if }j=k,\\-4/9&\text{if }j\neq k\end{cases}\\
    &=&4/3a_j^Ta_k
\end{eqnarray*}$$
Since the $a_i$ span $\mathbb R^3$, we have $\sum_i a_ia_i^T=4/3I$.
Now suppose the plane in question is $\{x\in\mathbb R^3\mid x\cdot n=k\}$ where $|n|=1$. The distance from $a_i$ to the plane is $d_i=a_i\cdot n-k$. Then
$$
  \sum_i(d_i+k)=\left(\sum_ia_i\right)\cdot n=0,
$$
$$
  \sum_i(d_i+k)^2=\sum_i n^Ta_ia_i^Tn=4/3|n|^2=4/3.
$$
Let $s_1=d_1+d_2+d_3$ and $s_2=d_1^2+d_2^2+d_3^2$. Then
$$
  s_1+d_4+4k=0,
$$
$$
  s_2+d_4^2+2k(s_1+d_4)+4k^2=4/3.
$$
Combining,
$$
  3d_4^2-2s_1d_4+4s_2-16/3-s_1^2=0
$$
Hence
$$
  d_4=\frac{s_1\pm\sqrt{16-12s_2+4s_1^2}}3.
$$
Note that for some values there are two positive solutions, since the tetrahedron can be reflected around the side spanned by $a_1,a_2,a_3$. If you assume the unknown vertex is the highest above the plane, then take the larger solution.
A: Since you're only interested in the elevation, the situation you describe is what happens when you rotate the tetrahedron around some line $L$ by some angle $\theta$. Indeed, the plane supported by $a$, $b$ and $c$ intersect the horizontal plane exactly in line $L$ and meets it at angle $\theta$.
If you can figure out $L$ and $\theta$, then it is easy to find the new elevation of $d$.
Denote by $h(x)$ the elevation of point $x$ after the rotation and $\operatorname{dist}(x)$ the distance from $x$ to $L$. If $x$ was originally in the horizontal plane, you have $h(x)=\operatorname{dist}(x)\cos\theta$. If you apply this to $b$ and $c$, you can figure out the angle between the equilateral triangle $abc$ and line $L$, from which you can deduce both the distance from point $d$ to $L$, and the angle between $d$, line $L$, and the orthogonal projection of $d$ onto the horizontal plane... You can probably figure out the rest (but feel free to ask about it).
A: 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.
