Calculating triangle coordinates from 3 lengths and its euler rotation in 3d space

euclidean-geometrygeometry

I have the following situation:

I have three constant points: $P_1(a_1, b_1, 0), P_2(a_2, b_2, 0), P_3(a_3, b_3, 0)$. These points are on a cartesian 3d space and form an equilateral triangle with a side length equal to len1.

I also have a second equilateral triangle let's call it $T$ (in the same 3d space) with a side length equal to len2 < len1 defined by three points $T_1(x_1, y_1, z_1), T_2(x_2, y_2, z_2), T_3(x_3, y_3, z_3)$ and a constraint: $z_1, z_2, z_3 > 0$. $len2$ is known.

The last known thing are 3 Euler angles: $θ_x, θ_y, θ_z$ which represent the rotation of triangle $Τ$ in the 3d space, $θ_x$ is the rotation of triangle $T$ in the $x$ axis and so on. Constraint: $-90 < θ_x, θ_y, θ_z < 90$ degrees.

The winding order of the triangle is the same, i.e. always $T_1,T_2,T_3$, not possible to have $T_3, T_1, T_2$ or other combinations. The minimum angle of the face normal of triangle $T$ with plane $z=0$ is $>0$ degrees. Just mentioning this to avoid situations like placing the triangle face down.

My first question is:

For all possible values of $(x_1, y_1, z_1), (x_2, y_2, z_2), (x_3, y_3, z_3)$, i.e. for all possible positions of triangle $T$ with side length =len2 and $z>0$ on a given rotation of the triangle $T$: $θ_x, θ_y, θ_z$, is there a unique vector $(L_1, L_2, L_3)$ where $L_1 = Dist(P_1, T_1), L_2 = Dist(P_2, T_2), L_3 = Dist(P_3, T_3)$ ?

My second question is:

If the answer to the previous question is yes, then given $L_1, L_2, L_3$ and the rotation $θ_x, θ_y, θ_z$ of triangle $Τ$, what are the equations for finding the coordinates of the three points $T_1, T_2, T_3$ of triangle $T$?

Thank you in advance.

Best Answer

Any transformation is decomposable into translation, deformation (here only isotropic deformation is present, due to equilaterality) and rotation. Rotation is done by three subsequent rotations with respect to 3 different axes, where the transformation order matters. The triangle after transformation is given by formula: \begin{align} \left[\begin{array}{c}x_i\\y_i\\z_i\end{array}\right]=\left[\begin{array}{c}X_0\\Y_0\\Z_0\end{array}\right]+ \underbrace{\frac{\text{len}_2}{\text{len}_1} \left[\begin{array}{ccc} c_3 & s_3 & 0 \\ -s_3 & c_3 & 0 \\ 0 & 0 & 1 \\ \end{array}\right] \left[\begin{array}{ccc} c_2 & 0 & s_2 \\ 0 & 1 & 0 \\ -s_2 & 0 & c_2 \\ \end{array}\right] \left[\begin{array}{ccc} 1 & 0 & 0 \\ 0 & c_1 & s_1 \\ 0 & -s_1 & c_1 \\ \end{array}\right]}_{\mathbf{A}} \left[\begin{array}{c}a_i\\b_i\\0\end{array}\right],~~i=1,2,3, \end{align} where $\text{len}_2<\text{len}_1,~z_i>0,~c_i=\cos(\theta_i),~s_i=\sin(\theta_i),~i=1,2,3$, $~\theta_1=\theta_x,~\theta_2=\theta_y,~\theta_3=\theta_z$, where matrix $\mathbf{A}$ is known and where the vector $[X_0,~Y_0,~Z_0]^{\text{T}}$ represents translation.

Continuation:

Moreover we have known distances $L_1,L_2,L_3$ so that we want \begin{align} &(x_i-a_i)^2+(y_i-b_i)^2+z_i^2=L_i^2,~~i=1,2,3, \end{align} and \begin{align} &z_i>0,~~i=1,2,3. \end{align} Also we have 12 equations \begin{align} &\left[\begin{array}{c}x_i\\y_i\\z_i\end{array}\right]=\left[\begin{array}{c}X_0\\Y_0\\Z_0\end{array}\right]+ \mathbf{A}\left[\begin{array}{c}a_i\\b_i\\0\end{array}\right],~~i=1,2,3,~~~~~~~~~~~~~~~(1)\\ &(x_i-a_i)^2+(y_i-b_i)^2+z_i^2=L_i^2,~~i=1,2,3,~~~~~~(2)\\ \end{align} for 12 unknowns $X_0,Y_0,Z_0,$ $x_i,y_i,z_i,i=1,2,3$. So we can hope, at least in some cases, in a unique solution. If this solution satisfies $z_i>0,~i=1,2,3$ then we are done. The following is however clear:

  1. There are such input parameters, that problem (1,2) has no solution
  2. In case $\text{len}_2=\text{len}_1$ there are such input parameters, that problem (1,2) has infinitely many solutions

Proof: 1. for $\mathbf{A}=\mathbf{0},~L_1=L_2=L_3=0$ and different points $P_1,~P_2,~P_3$ the problem definitely has no solution. 2. for $\mathbf{A}=\mathbf{I},~L_1=L_2=L_3=1$ we see that for any $X_0,Y_0,Z_0$ s.t. $X_0^2+Y_0^2+Z_0^2=1$ we get solution, which satifies Eq.(2), ergo we have infinitely many different nontrivial solutions in this case. $\clubsuit$

Remark (uniqueness in case len2<len1): If we insert Eqs.(1) into Eqs.(2) we can solve instead of 12 equations only 3 nonlinear equations: \begin{align} &(X_0+(a_{11}-1)a_i+a_{12}b_i)^2+(Y_0+a_{21}a_i+(a_{22}-1)b_i)^2+\\&(Z_0+a_{31}a_i+a_{32}b_i)^2=L_i^2,~~i=1,2,3.~~~~~~(3)\\ \end{align} This is a problem of intersection of three spheres in $\mathbb{R}^3$, which has in general $0,1,2$ solutions (infinite number of solutions are not possible in case len2<len1). If we can proof, that in case of 2 different solutions one yields negative values of $z_i$ (which is indicated by all numerical solutions, which I have tried), then the proof of uniqueness is made. $\diamondsuit$

Related Question