I have three points in $3$-D space, say ${\bf p}_i, i=1,2,3$. A new co-ordinate system, $\{2\}$, is defined such that:
- The origin is located at the circumcentre, ${\bf p}_0$, of the triangle given by points ${\bf p}_i$.
- The $x$-axis is in the same direction as the vector ${\bf p}_{10}$, i.e., (${\bf p}_1-{\bf p}_0$).
- The $z$-axis is normal to the plane formed by the points, ${\bf p}_i$.
I wish to find the transformation matrix (rotation matrix and translation vector) so that the initial frame is transformed to the frame $\{2\}$. Also, the circumradius, $\rho$, is required.
I have used the following method to obtain the results:
- ${\bf a} = {\bf p}_1 - {\bf p}_3$, ${\bf b}={\bf p}_2-{\bf p}_3$
- $\rho=\frac{\|{\bf a}\|\|{\bf b}\|\|\bf a-b\|}{2\|\bf a\times b\|}$
- ${\bf p}_0=\frac{(\|{\bf a}\|^2{\bf b}-\|{\bf b}\|^2{\bf a})\times (\bf a \times b)}{2 \|\bf a \times b\|^2}+{\bf p}_3$
- ${\bf \hat{x}}_2=\frac{{\bf p}_1-{\bf p}_0}{\|{\bf p}_1-{\bf p}_0\|}$
- ${{\bf \hat{z}}}_2=\frac{{\bf \hat{x}_2}\times ({\bf p}_2-{\bf p}_0)}{\|{\bf \hat{x}_2}\times ({\bf p}_2-{\bf p}_0)\|}$
- ${{\bf \hat{y}}}_2=\frac{{\bf \hat{z}_2}\times {\bf \hat{x}_2}}{\|{\bf \hat{z}_2}\times {\bf \hat{x}_2}\|}$
- ${\bf R}= [{{\hat{\bf x}}_2},{{\hat{\bf y}}_2},{{\hat{\bf z}}_2}]$
Questions:
It is required that the Rotation matrix, ${\bf R}$, be obtained in closed form. I was expecting a simpler form. However, the end result turns out to be very complicated and is not solvable on paper. Can the problem be solved in a much simpler way?
What are the flaws in this method? If the points are collinear, then the algorithm will fail.
How can we determine the correctness of the solution?