Find 4th vertex of tetrahedron given 3 vertices and 3 angles

371 Views Asked by At

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$:

tetrahedron PQRE

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.

2

There are 2 best solutions below

5
On BEST ANSWER

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?

2
On

For clarity, let $$\begin{aligned} L_{PQ} &= \lVert Q - P \rVert, \\ L_{PR} &= \lVert R - P \rVert, \\ L_{QR} &= \lVert R - Q \rVert, \\ \end{aligned} \quad \begin{aligned} L_{PE} &= \lVert E - P \rVert, \\ L_{QE} &= \lVert E - Q \rVert, \\ L_{RE} &= \lVert E - R \rVert, \\ \end{aligned} \quad \begin{aligned} \varphi_{PQ} &= \angle P E Q \\ \varphi_{PR} &= \angle P E R \\ \varphi_{QR} &= \angle Q E R \\ \end{aligned}$$ The area of each triangular side is $$\begin{aligned} A_{PEQ} &= \frac{1}{2} L_{PE} L_{QE} \sin\varphi_{PQ} \\ A_{PER} &= \frac{1}{2} L_{PE} L_{RE} \sin\varphi_{PR} \\ A_{QER} &= \frac{1}{2} L_{QE} L_{RE} \sin\varphi_{QR} \\ \end{aligned} \tag{1}\label{None1}$$ On the other hand, using Heron's formula for the areas we have $$\begin{aligned} A_{PEQ} &= \frac{1}{4}\sqrt{ 4 L_{PE}^2 L_{QE}^2 - ( L_{PE}^2 + L_{QE}^2 - L_{PQ}^2 )^2 } \\ A_{PER} &= \frac{1}{4}\sqrt{ 4 L_{PE}^2 L_{RE}^2 - ( L_{PE}^2 + L_{RE}^2 - L_{PR}^2 )^2 } \\ A_{QER} &= \frac{1}{4}\sqrt{ 4 L_{QE}^2 L_{RE}^2 - ( L_{QE}^2 + L_{RE}^2 - L_{QR}^2 )^2 } \\ \end{aligned} \tag{2}\label{None2}$$ Combining $\eqref{None1}$ and $\eqref{None2}$, and multiplying each equation by 4, we have $$\left\lbrace ~ \begin{aligned} 2 L_{PE} L_{QE} \sin\varphi_{PQ} = \sqrt{ 4 L_{PE}^2 L_{QE}^2 - ( L_{PE}^2 + L_{QE}^2 - L_{PQ}^2 )^2 } \\ 2 L_{PE} L_{RE} \sin\varphi_{PR} = \sqrt{ 4 L_{PE}^2 L_{RE}^2 - ( L_{PE}^2 + L_{RE}^2 - L_{PR}^2 )^2 } \\ 2 L_{QE} L_{RE} \sin\varphi_{QR} = \sqrt{ 4 L_{QE}^2 L_{RE}^2 - ( L_{QE}^2 + L_{RE}^2 - L_{QR}^2 )^2 } \\ \end{aligned} \right . \tag{3}\label{None3}$$ Because the angles are all positive and less than $180°$, the sines are all nonnegative, and both sides of each equation are nonnegative. Thus, we can square both sides. Simplifying and rearranging the terms in each equation, we get $$\left\lbrace ~ \begin{aligned} (L_{PE}^2 + L_{QE}^2 - L_{PQ}^2)^2 &= 2^2 L_{PE}^2 L_{QE}^2 (1 - (\sin\varphi_{PQ})^2) \\ (L_{PE}^2 + L_{RE}^2 - L_{PR}^2)^2 &= 2^2 L_{PE}^2 L_{RE}^2 (1 - (\sin\varphi_{PR})^2) \\ (L_{QE}^2 + L_{RE}^2 - L_{QR}^2)^2 &= 2^2 L_{QE}^2 L_{RE}^2 (1 - (\sin\varphi_{QR})^2) \\ \end{aligned} \right . \tag{4}\label{None4}$$ The rightmost term in each is equivalent to cosine of the same angle squared. Since both sides of each equation are nonnegative, we can take the square root. Rearranging the terms, we get $$\left\lbrace ~ \begin{aligned} L_{PE}^2 + L_{QE}^2 - 2 L_{PE} L_{QE} \cos\varphi_{PQ} - L_{PQ}^2 &= 0 \\ L_{PE}^2 + L_{RE}^2 - 2 L_{PE} L_{RE} \cos\varphi_{PR} - L_{PR}^2 &= 0 \\ L_{QE}^2 + L_{RE}^2 - 2 L_{QE} L_{RE} \cos\varphi_{QR} - L_{QR}^2 &= 0 \\ \end{aligned} \right . \tag{5}\label{None5}$$ which, as Aretino pointed out in a comment, we could have actually started with, as it is literally just the cosine rule applied to each triangle.

Solving the first equation for $L_{QE}$ yields $$L_{QE} = L_{PE} \cos\varphi_{PQ} \pm \sqrt{ L_{PQ}^2 - (L_{PE} \sin\varphi_{PQ})^2 } \tag{6a}\label{None6a}$$ and solving the second equation for $L_{RE}$ yields $$L_{RE} = L_{PE} \cos\varphi_{PR} \pm \sqrt{ L_{PR}^2 - (L_{PE} \sin\varphi_{PR})^2 } \tag{6b}\label{None6b}$$ Substituting $L_{QE}$ and $L_{RE}$ to the third equation and solving for $L_{PE}$ yields two solutions each, one negative and one positive, but only the positive ones make physical sense (edge lengths are nonnegative). Furthermore, choosing either sign for $L_{RE}$ yields the same positive $L_{PE}$, so there are really only two unique candidate $L_{PE}$.

The exact expressions when substituting $L_{QE}$ and $L_{RE}$ candidates to the third equation, with $L_{PE}$ the only unknown, are

+ + : sqrt(L_PQ^2 - L_PE^2*sin(phi_PQ)^2)*(2*L_PE*cos(phi_PQ) - 2*L_PE*cos(phi_PR)*cos(phi_RQ)) + sqrt(L_PR^2-L_PE^2*sin(phi_PR)^2)*(-2*sqrt(L_PQ^2-L_PE^2*sin(phi_PQ)^2)*cos(phi_RQ) - 2*L_PE*cos(phi_PQ)*cos(phi_RQ) + 2*L_PE*cos(phi_PR)) - 2*L_PE^2*cos(phi_PQ)*cos(phi_PR)*cos(phi_RQ) + 2*L_PE^2*cos(phi_PR)^2 - 2*L_PE^2*sin(phi_PQ)^2 - L_RQ^2 + L_PR^2 + L_PQ^2 = 0 $
+ - : sqrt(L_PQ^2 - L_PE^2*sin(phi_PQ)^2)*(2*L_PE*cos(phi_PQ) - 2*L_PE*cos(phi_PR)*cos(phi_RQ)) + sqrt(L_PR^2-L_PE^2*sin(phi_PR)^2)*( 2*sqrt(L_PQ^2-L_PE^2*sin(phi_PQ)^2)*cos(phi_RQ) + 2*L_PE*cos(phi_PQ)*cos(phi_RQ) - 2*L_PE*cos(phi_PR)) - 2*L_PE^2*cos(phi_PQ)*cos(phi_PR)*cos(phi_RQ) + 2*L_PE^2*cos(phi_PR)^2 - 2*L_PE^2*sin(phi_PQ)^2 - L_RQ^2 + L_PR^2 + L_PQ^2 = 0 $
- + : sqrt(L_PQ^2 - L_PE^2*sin(phi_PQ)^2)*(2*L_PE*cos(phi_PR)*cos(phi_RQ) - 2*L_PE*cos(phi_PQ)) + sqrt(L_PR^2-L_PE^2*sin(phi_PR)^2)*( 2*sqrt(L_PQ^2-L_PE^2*sin(phi_PQ)^2)*cos(phi_RQ) - 2*L_PE*cos(phi_PQ)*cos(phi_RQ) + 2*L_PE*cos(phi_PR)) - 2*L_PE^2*cos(phi_PQ)*cos(phi_PR)*cos(phi_RQ) + 2*L_PE^2*cos(phi_PR)^2 - 2*L_PE^2*sin(phi_PQ)^2 - L_RQ^2 + L_PR^2 + L_PQ^2 = 0 $
- - : sqrt(L_PQ^2 - L_PE^2*sin(phi_PQ)^2)*(2*L_PE*cos(phi_PR)*cos(phi_RQ) - 2*L_PE*cos(phi_PQ)) + sqrt(L_PR^2-L_PE^2*sin(phi_PR)^2)*(-2*sqrt(L_PQ^2-L_PE^2*sin(phi_PQ)^2)*cos(phi_RQ) + 2*L_PE*cos(phi_PQ)*cos(phi_RQ) - 2*L_PE*cos(phi_PR)) - 2*L_PE^2*cos(phi_PQ)*cos(phi_PR)*cos(phi_RQ) + 2*L_PE^2*cos(phi_PR)^2 - 2*L_PE^2*sin(phi_PQ)^2 - L_RQ^2 + L_PR^2 + L_PQ^2 = 0 $

In implicit form, after simplifying the expressions, Maxima describes the solutions as

L_PE^2 = sqrt(L_PQ^2 - L_PE^2*sin(phi_PQ)^2) * (2*L_PE*cos(phi_PQ) - 2*L_PE*cos(phi_PR)*cos(phi_QR))
       + sqrt(L_PR^2 - L_PE^2*sin(phi_PR)^2) * ( 2*sqrt(L_PQ^2 - L_PE^2*sin(phi_PQ)^2) * cos(phi_QR) - 2*L_PE*cos(phi_PQ)*cos(phi_QR) + 2*L_PE*cos(phi_PR))
       + 2*L_PE^2*cos(phi_PQ)*cos(phi_PR)*cos(phi_QR) + 2*L_PE^2*sin(phi_PQ)^2 - 2*L_PE^2*cos(phi_PR)^2 + L_QR^2 - L_PR^2

L_PE^2 = sqrt(L_PQ^2 - L_PE^2*sin(phi_PQ)^2) * (2*L_PE*cos(phi_PR)*cos(phi_QR) - 2*L_PE*cos(phi_PQ))
       + sqrt(L_PR^2 - L_PE^2*sin(phi_PR)^2) * (-2*sqrt(L_PQ^2 - L_PE^2*sin(phi_PQ)^2) * cos(phi_QR) - 2*L_PE*cos(phi_PQ)*cos(phi_QR) + 2*L_PE*cos(phi_PR))
       + 2*L_PE^2*cos(phi_PQ)*cos(phi_PR)*cos(phi_QR) + 2*L_PE^2*sin(phi_PQ)^2 - 2*L_PE^2*cos(phi_PR)^2 + L_QR^2 - L_PR^2

where L_PE is the only unknown variable, but appears on both sides of the equation. I do not know if this can be massaged to an algebraic solution, or if these need to be solved numerically.

Substituting each candidate $L_{PE}$ to $\eqref{None6a}$ and $\eqref{None6b}$ yields a candidate triplet $L_{PE}$, $L_{QE}$, $L_{RE}$, which need to be verified to produce the correct angles $\varphi_{PQ}$, $\varphi_{PR}$, and $\varphi_{QR}$.

Verifying that $L_{PE} \gt 0$, $L_{QE} \gt 0$, $L_{RE} \gt 0$ (for a non-degenerate tetrahedron), and that they fulfill $\eqref{None5}$, is sufficient: it is equivalent to constructing the tetrahedron.

When a triplet $L_{PE}$, $L_{QE}$, $L_{RE}$ that fulfills $\eqref{None5}$ is found, the coordinates of $E$ are found via standard trilateration using $P$, $Q$, $R$, $L_{PE}$, $L_{QE}$, and $L_{RE}$.