Today I derived, geometrically, the following:

\begin{equation}

(A * B)^{T} = C \\ C = B^{T} * A^{T}

\label{eq1}

\end{equation}

Listed on the wikipedia page without much a description (property number 3), this property hid from me for a good 24 hours and confused me. I had been working on creating an optimized implementation to find the closest points between two OBBs. After consulting Ericson’s orange book to make sure my hand derivation would lead to optimized code I realized I was doing an extra matrix multiplication. Ericson’s book doesn’t always lay out all the prerequisite information up front, so sometimes hard work and time is required to derive more exotic mathematic rules and properties.

Given two OBBs with orientations of A and B respectively, it is helpful to represent B in the reference frame of A in order to reduce necessary computations. This gives a new transformation called C and is calculated as:

\begin{equation}

A^{T} * B = C

\label{eq2}

\end{equation}

The next series of tests can be performed in similar fashion by representing A in B’s reference frame. Naively, I tried to perform:

\begin{equation}

B^{T} * A

\label{eq3}

\end{equation}

However, it can be shown that C in \eqref{eq2} transposed is equivalent to \eqref{eq3} given \eqref{eq1}. Geometrically this also makes sense, and is easier to understand if you have some intuition about rotation matrices. Luckily a rotation matrix is in and of itself pretty intuitive. If C brings B to A’s frame, then clearly the reverse mapping would go from A’s frame to B. In matrix land in order to reverse a transformation you also have to reverse the matrix concatenation order.

I found on stack overflow a nice way to imagine this in plain english: if I put on socks and then shoes, to reverse the operation I must first take off my shoes and then take off my socks.

niksCool thanks :)