Using TransformationFunction

I try to use the result from the function FindGeometricTransform. It returns an error and a TransformationFunction.

The TransformationFunction is technically a $4\times 4$ matrix. But how can I use the result? It is not really a $4\times 4$ matrix like

(m = {{1., 0., 0., 1.}, {0., 1., 0., 2.}, {0., 0., 1., 0.}, {0., 0.,
0., 1.}}) // MatrixForm

result = FindGeometricTransform[{{2, 2, 0}, {2, 4, 0}}, {{1, 2, 0}, {3,
2, 0}}];


I would like to multiply the TransformationFunction with m. How can I do that? Trying result[[2]].m does not work.

You have to use the TransformationMatrix instead of the TransformationFunction:

TransformationMatrix@result[[2]]


{{0., -1., 0., 4.}, {1., 0., 0., 1.}, {0., 0., 1., 0.}, {0., 0., 0., 1.}}

TransformationMatrix@result[[2]].m


{{0., -1., 0., 2.}, {1., 0., 0., 2.}, {0., 0., 1., 0.}, {0., 0., 0., 1.}}

You can extract the matrix from result using Part:

result[[2, 1]].m

{{0., -1., 0., 2.}, {1., 0., 0., 2.}, {0., 0., 1., 0.}, {0., 0., 0., 1.}}


Karsten shows what you can do if you want the homogeneous matrix and not the TransformationFunction[] itself. If you want a TransformationFunction[] result, use Composition[]:

result = FindGeometricTransform[{{2, 2, 0}, {2, 4, 0}}, {{1, 2, 0}, {3, 2, 0}}];
m = {{1., 0., 0., 1.}, {0., 1., 0., 2.}, {0., 0., 1., 0.}, {0., 0., 0., 1.}};

Composition[result[[2]], TransformationFunction[m]]
TransformationFunction[{{0., -1., 0., 2.}, {1., 0., 0., 2.},
{0., 0., 1., 0.}, {0., 0., 0., 1.}}]