Find 4th vertex of tetrahedron given 3 vertices and 3 angles I have a tetrahedron which I know the coordinates of 3 vertices $PQR$ and I need to calculate the coordinate of the 4th vertex $E$ since I know the angles around $E$: $\theta_0$, $\theta_1$ and $\theta_2$:

I tried to solve this by defining a system:
$$\cos{\theta_0}=\frac{\vec{ER} \cdot \vec{EP}}{||\vec{ER}\||||\vec{EP}||}$$
$$\cos{\theta_1}=\frac{\vec{ER} \cdot \vec{EQ}}{||\vec{ER}\||||\vec{EQ}||}$$
$$\cos{\theta_2}=\frac{\vec{EP} \cdot \vec{EQ}}{||\vec{EP}\||||\vec{EQ}||}$$
with no success. I appreciate if someone can provide some help.
 A: This is not a full answer, but perhaps someone better at maths could complete this?
Without any loss in generality, we can rotate, translate, and scale the coordinate system so that $P$ is at origin $(0, 0, 0)$, $Q$ is at $(1, 0, 0)$, $R$ is at $(\chi, \gamma, 0)$, and the fourth vertex $E$ is at $(x, y, z)$.
We can do this via constructing the new orthonormal basis vectors $\hat{u}$, $\hat{v}$, $\hat{w}$ via
$$\begin{aligned}
L &= \lVert Q - P \rVert \\
\hat{u} &= \frac{Q - P}{L} \\
\vec{v} &= R - P - \hat{u}\bigr(\hat{u}\cdot(R - P)\bigr) \\
\hat{v} &= \frac{\vec{v}}{\lVert\vec{v}\rVert} \\
\hat{w} &= \hat{u} \times \hat{v} \\
\end{aligned}$$
such that
$$\begin{aligned}
\chi &= \frac{1}{L}(R - P) \cdot \hat{u} \\
\gamma &= \frac{1}{L}(R - P) \cdot \hat{v} \\
E &= P + L x \hat{u} + L y \hat{v} + L z \hat{w} \\
\end{aligned}$$
The three edge vectors from $E$ to $P$, $Q$, and $R$, respectively, are
$$\begin{aligned}
\vec{e}_P &= (-x, -y, -z) \\
\vec{e}_Q &= (1 - x, -y, -z) \\
\vec{e}_R &= (\chi - x, \gamma - y, -z) \\
\end{aligned}$$
and assuming a non-degenerate tetrahedron with nonzero edge lengths, the three angles $\theta_{PQ}$, $\theta_{PR}$, and $\theta_{QR}$ fulfill
$$\left\lbrace ~\begin{aligned}
\cos(\theta_{PQ}) &= \frac{ \vec{e}_P \cdot \vec{e}_Q }{ \lVert\vec{e}_P\rVert \lVert\vec{e}_Q\rVert } \\
\cos(\theta_{PR}) &= \frac{ \vec{e}_P \cdot \vec{e}_R }{ \lvert\vec{e}_P\rVert \lVert\vec{e}_R\rVert } \\
\cos(\theta_{QR}) &= \frac{ \vec{e}_Q \cdot \vec{e}_R }{ \lvert\vec{e}_Q\rVert \lVert\vec{e}_R\rVert } \\
\end{aligned}\right.$$
In Cartesian coordinate form, this is
$$\left\lbrace ~ \begin{aligned}
\cos(\theta_{PQ}) &= \frac{ x (x - 1) + y^2 + z^2 }{\sqrt{ \bigr( x^2 + y^2 + z^2 \bigr) \bigr( (x-1)^2 + y^2 + z^2 \bigr) }} \\
\cos(\theta_{PR}) &= \frac{ x (x - \chi) + y (y - \gamma) + z^2 }{\sqrt{ \bigr( x^2 + y^2 + z^2 \bigr) \bigr( (x - \chi)^2 + (y - \gamma)^2 + z^2 \bigr) }} \\
\cos(\theta_{QR}) &= \frac{ (x - 1)(x - \chi) + y (y - \gamma) + z^2}{\sqrt{\bigr( (x-1)^2 + y^2 + z^2 \bigr)\bigr( (x - \chi)^2 + (y - \gamma)^2 + z^2 \bigr) }} \\ 
\end{aligned} \right.$$
Unfortunately, my laptop overheated before Maxima could find a solution to the above.
If we use $d^2 = x^2 + y^2 + z^2$ as shorthand, then
$$\left\lbrace ~ \begin{aligned}
\cos(\theta_{PQ}) &= \frac{d^2 - x}{d\sqrt{d^2 + 1 - 2 x}} \\
\cos(\theta_{PR}) &= \frac{d^2 - \chi x - \gamma y}{d\sqrt{d^2 - \chi ( 2 x - \chi) - \gamma ( 2 y - \gamma ) }} \\
\cos(\theta_{QR}) &= \frac{d^2 + \chi - x - \chi x - \gamma y}{\sqrt{\big( d^2 + 1 - 2 x \big)\big( d^2 - \chi ( 2 x - \chi) - \gamma ( 2 y - \gamma ) \big)}} \\
\end{aligned} \right.$$
so perhaps we should try and solve for $x/d$, $y/d$, and $z/d$ first, via a change in variables?
