Given two points with 3D coordinates, and three angle observations, how to caculate the coordinate of the third point

geodesicgeodesygeometrylinear algebratrigonometry

Given two points, $M_1(X_1,Y_1,Z_1)$ and $M_2(X_2,Y_2,Z_2)$,$P(X_p, Y_p,Z_p)$ is the unknown point. How to get the coordinates of $P$ by three angle observation .
The picture below displays the relationship between these points and observations.
$Q_1(X_1,Y_1,Z_p)$,$Q_2(X_2,Y_2,Z_p)$,$P(X_p, Y_p,Z_p)$ are on the horizontal plane $Z=Z_p$, the coords of $Q_1, Q_2$ means $M_1Q_1\bot Q_1P, M_2Q_2\bot Q_2P$. We have known three angle observations $\beta_1=\angle Q_1PM_1, \beta_2=\angle Q_2PM_2, \gamma=\angle Q_1PQ_2$. How to get $P(X_p, Y_p,Z_p)$?

enter image description here

I've tried to use vector vector angle formula to list three equations but it's hard to solve it. Can we denote $P(X_p, Y_p,Z_p)$ as
$$X_p=f(X_1,Y_1,Z_1,X_2,Y_2,Z_2, \beta_1, \beta_2, \gamma)$$
$$Y_p=g(X_1,Y_1,Z_1,X_2,Y_2,Z_2, \beta_1, \beta_2, \gamma)$$
$$Z_p=u(X_1,Y_1,Z_1,X_2,Y_2,Z_2, \beta_1, \beta_2, \gamma)$$

Best Answer

Let $r_1=PQ_1$ and $r_2=PQ_2$. You have then two equations for the unknowns $r_1$, $r_2$: $$ r_1\tan\beta1-r_2\tan\beta_2=z_1-z_2; \quad r_1^2+r_2^2-2r_1r_2\cos\gamma=(x_1-x_2)^2+(y_1-y_2)^2. $$ You can solve and find $r_1$, $r_2$. You can then obtain the coordinates of $P$ from: $$ (x_p-x_1)^2+(y_p-y_1)^2=r_1^2; \quad (x_p-x_2)^2+(y_p-y_2)^2=r_2^2; \quad z_p=z_1-r_1\tan\beta_1. $$