I am developing a docking application in which I want to have for every step the difference between the target transformation matrix and the user's transformation matrix. Now I don't have any problem with the coding part but rather with the linear algebra part.

So let's say T is my target transformation matrix, and U is the user's transformation matrix.

To get the difference between the two matrices I do:

(U^-1) * (T) = Difference

Now my matrices are formed with translation, rotation and scaling. My question would be how I should measure the total translation difference as well as the total rotation difference (not interested in the scaling part).

Thanks in advance,


This is known as a Procrustes problem or one of it's generalizations, depending on how advanced you want to make it.

  • 1
    $\begingroup$ I didn't know the name, thanks a lot for that. However, I've read the page and it doesn't really help in the calculation of how to compute total translation difference and total rotation difference, or does it? $\endgroup$ – LBes Aug 16 '15 at 16:27
  • $\begingroup$ You can use the singular value decomposition or polar decomposition. There is a quite straight forward description on the site. It is a good exercise if you are a math student anyways. $\endgroup$ – mathreadler Aug 16 '15 at 16:46
  • $\begingroup$ But a SVD gives me yet an other matrix, is there a way to quantify this total difference for both rotation and translation with a single number? $\endgroup$ – LBes Aug 16 '15 at 16:48
  • $\begingroup$ You could measure how much the transformation differs from the identity transformation in different ways. The easiest would be just an $L_2$ norm of the difference $|M-I|_2$. $\endgroup$ – mathreadler Aug 16 '15 at 17:02
  • $\begingroup$ I'm thinking that the difference in rotation could be directly measured in angles and I might use what you suggested for the difference in translation $\endgroup$ – LBes Aug 16 '15 at 17:30

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.