Find the affine transformation between 2 triangles in 3D I have a triangle T and its transformed version T' - i.e, I know the correspondence of vertices between the two triangles.
Is it possible to find the affine transformation A, that transformed T to T'?
I know v1,v2,v3 of T and v1',v2',v3' of T', where each v has a 3D coordinate (x,y,z).
The affine transformation I believe has 12 parameters, so ideally I'd need 4 points to find A. But is there a way to do it with 3 known points (even if approximately)?
Thank you for any ideas..
 A: We assume that the two triangles are non-degenerate.
In fact, in the general case, a linear transform  fulfilling the task. Here is how.
As $A$ must send $V_k$ onto $V'_k$ for $k=1,2,3$, we can write:
$$A \times \underbrace{\begin{pmatrix}|&|&|\\V_1&V_2&V_3\\|&|&|\end{pmatrix}}_{B} = \underbrace{\begin{pmatrix}|&|&|\\V'_1&V'_2&V'_3\\|&|&|\end{pmatrix}}_{B'}$$
Two cases :

*

*The general case : If $\{V_1,V_2,V_3\}$ are independent, matrix $B^{-1}$ exists, and we can take

$$A=B'B^{-1}$$
for the matrix of the transformation.

*

*If ${V_1,V_2,V_3}$ are dependent (it means that the plane defined by the initial triangle passes through the origin), corresponding matrix $B$ has rank $2$. Then, taking a translation $t$ along the normal vector of this plane, replacing  $\{V_1,V_2,V_3\}$ by $t(\{V_1,V_2,V_3\})$, we are back to the previous case with the existence of a linear transform $\ell$ such that :

$$\ell(t(\{V_1,V_2,V_3\}))=\{V'_1,V'_2,V'_3\}$$
Therefore, composition $a=\ell \circ t$ is a solution.
