# How can I calculate the transformation between two 3D triangles?

I am given the $3$-D coordinates of two triangles. For example:

• for $\triangle ABC$, the coordinates are: $A=(0, 0, 0)$, $B= (3.37576, 0, 0)$, $C=(5.14131, -2.47202, 0)$

and

• for $\triangle DEF$ the coordinates are: $D=(0, 0, 0)$, $E(3.73345, 0, 0)$, $F=(7.06825, -3.44094, 0)$.

How to calculate the transformation matrix between two triangles?

Any help will be largely appreciated!

-
Do you see that both triangles lie in the x-y coordinate plane? (i.e., both triangles are, essentially, in 2-dimensions), Each with a vertex at the origin (A, D), and each with one side lying along the x-axis, overlapping (side DE a bit longer than side AB?), and each lying in the same quadrant? – amWhy May 31 '11 at 22:38

This particular case is rather simple. Note:

$$\frac{3.73345}{3.37576} \approx 1.105958,$$

$$\frac{7.06825 - 5.14131\times 1.105958}{-2.47202} \approx -0.559128, \text{ and}$$

$$\frac{-3.44094}{-2.47202} \approx 1.391958.$$

so giving a solution of

$$\left( \begin{array}{ccc} 1.105958 & -0.559128 & c \\ 0 & 1.391958 & f \\ 0 & 0 & i \end{array} \right)$$

where $c$, $f$ and $i$ can take any values because, as amWhy noted, you only have information about the x-y plane. In general it will be slightly more complicated.

-
Hi thanks for the detailed answer! Can you please explain the math behind this calculation? What are the rotation and translation component of the given solution? – Irina Jun 1 '11 at 15:19
@Irina: there is no translation component (the origin stays at the origin), and the transformation is not a rotation (the two triangles have different areas and different shapes). So you need to move B to E along the $x$-axis and move the $x$ and $y$ components of C to the components of F. – Henry Jun 1 '11 at 15:35
@Henry: So what does the resultant matrix represent? – Irina Jun 2 '11 at 13:13
@Irina: it is a linear transformation. – Henry Jun 2 '11 at 14:54
Does it mean if I apply this linear transformation on each point of triangle DEF, will DEF fall on ABC? – Irina Jun 2 '11 at 18:27