Angles between lateral faces of any rectangular-based pyramid I was just wondering if anyone had any idea how to solve this problem:
What is the angle between lateral faces of a rectangular-based pyramid with length a, width b, and height h, in terms of a, b and h?
Any responses are much appreciated.
 A: Set up a coordinate system such that pyramid vertex is $V=(0,0,h)$ and base vertices are $A=(b/2,a/2,0)$, $B=(-b/2,a/2,0)$, $C=(-b/2,-a/2,0)$, 
$D=(b/2,-a/2,0)$.
A vector $N_1$ perpendicular to face $VAB$ (and directed outwards) can be found by
$$
N_1=(A-V)\times(B-V)=
\left({b\over2},{a\over2},-h\right)\times\left(-{b\over2},{a\over2},-h\right)
=\left(0,hb,{ab\over2}\right).
$$
Analogously, one can find a vector $N_2$ perpendicular to face $VAD$ and directed inwards:
$$
N_2=-(D-V)\times(A-V)=
-\left({b\over2},-{a\over2},-h\right)\times\left({b\over2},{a\over2},-h\right)
=-\left(ha,0,{ab\over2}\right).
$$
Angle $\theta$ between those faces is also the angle between $N_1$ and $N_2$, so it can be found by
$$
\cos\theta={N_1\cdot N_2\over|N_1|\cdot |N_2|}=
{-1\over\sqrt{1+4h^2/a^2}\sqrt{1+4h^2/b^2}}.
$$
A: Brief hints:
half-diagonal = HD=$\dfrac{\sqrt{a^2+b^2}}{2}$
tetrahedron slant length = L= $ \sqrt {h^2+HD^2}  $
Calculate $h1,h2$ as altitudes of lateral isosceles triangles sides as all the three sides are known.
Basis of calculation: 
To find Dihedral Angle between normals of adjacent faces containing $h1,h2$. Using $c,s$ short for $\cos, \sin, $
$$ s_{\alpha}= \frac{a}{2 L};\,s_{\beta}= \frac{b}{2 L};\, \tag1$$
As pointed by Mick,feet of perpendiculars should have an offset as now shown in the diagram. To consider this a development ( unfolded view ) of two neighboring sides is included that builds to the tetrahedral inter-hedral angle as dihedral angle.
coordinates $A= A_1$
$$ L[ c_{2 \alpha} ,s_{2\alpha},0] \tag2$$
coordinates $ A_2$ after rotation by angle$\gamma$ with side $OP$ as hinge
$$ L[ c_{2 \alpha} ,-s_{2\alpha} \cos \gamma,s_{2\alpha} s_ \gamma \tag3$$
coordinates $ B$
$$ L[ c_{2 \beta} ,-s_{2\beta},0] \tag4$$
Now let us find distance $A_2$ after folding to B
$$d^2_{B-A_2} /L^2= a^2+b^2  \tag5 $$
$$[  ( c_{2 \alpha} - c_{2 \beta} )^2 -
 (s_{2 \alpha} c_\gamma + s_{2 \beta} )^2+  s_{2 \alpha} s_\gamma )^2= \frac{a^2+b^2 }{L^2}\tag6 $$
which simplifies  further to 
$$  \frac{a^2+b^2 }{L^2}= 1 + \cos 2\alpha (\cos 2 \alpha+ 2\cos  2 \beta  )+\sin  2 \alpha (\sin 2 \alpha +2 \cos \gamma \sin 2 \beta  ) \tag7$$
$$  \frac{a^2+b^2 }{2 L^2}= 1 + \cos 2\alpha \cos  2 \beta +  \cos \gamma\, \sin  2 \alpha \sin 2 \beta  \tag8$$
from which $\gamma$ can be found. That is one method. Hope you can check if there are no errors or some trig simplification can still be effected.

A: @Aretino's coordinate/vector approach might be the most accessible, but it's worth mentioning a couple of others.

Given any three-faced "corner", one can determine the dihedral angles from the face angles (or vice-versa) using an appropriate Spherical Law of Cosines. For the problem at hand, with this configuration ...

... we can write ...

$$\cos\angle APB = \cos\angle APC \cos \angle BPC + \sin\angle APC \sin\angle BPC \cos\angle PC \tag{$\star$}$$

where "$\angle PC$" indicates the dihedral angle along $\overline{PC}$. In our rectangular pyramid, $\angle APB$ is a right angle, so that $(\star)$ reduces to

$$\cos\angle PC = -\cot\angle APC \cot\angle BPC \tag{1}$$

Labeling a few distances, including $m$ and $n$ as altitudes of faces $\triangle CPA$ and $\triangle CPB$, ...

... we have ...
$$\cos \angle PC = -\frac{a/2}{m} \cdot \frac{b/2}{n} = -\frac{ab}{4mn} \tag{2}$$
Invoking Pythagoras,
$$m^2 = \left(\frac{b}{2}\right)^2 + h^2 = \frac{1}{4}\left( b^2 + 4 h^2 \right) \qquad\qquad n^2 = \frac{1}{4}\left( a^2 + 4 h^2 \right)$$
we have

$$\cos\angle PC = -\frac{ab}{\sqrt{(a^2 + 4 h^2 )(b^2 + 4 h^2 )}} \tag{3}$$


I would be remiss not to also mention a solution using a hedronometric ("area-based") Law of Cosines for Tetrahedra. In particular:

$$\begin{align}
&|\triangle PAC|^2 + |\triangle PBC|^2 - 2 |\triangle PAC||\triangle PBC|\cos\angle PC \\
= &|\triangle ACB|^2 + |\triangle APB|^2 - 2|\triangle ACB||\triangle APB|\cos\angle AB
\end{align} \tag{$\star\star$}$$

As dihedral $\angle AB$ is a right angle, isolating $\cos \angle PC$ gives:
$$\cos\angle PC = \frac{|\triangle PAC|^2 + |\triangle PBC|^2 - |\triangle ACB|^2 - |\triangle APB|^2}{2|\triangle PAC||\triangle PBC|} \tag{4}$$
Then, since ...
$$
|\triangle PAC| = \frac12 a m = \frac14 a \sqrt{b^2 + 4 h^2} \qquad\qquad
|\triangle PBC| = \frac12 b n = \frac14 b \sqrt{a^2 + 4 h^2 }$$
$$
|\triangle ACB| = \frac12 h |\overline{AB}| = \frac12 h \sqrt{a^2+b^2} \qquad\qquad |\triangle APB| = \frac12 ab$$
... we find that $(4)$ ultimately reduces to $(3)$. $\square$
