# Affine transformation matrixes

I could use some advise with the following problem: Lets say there is a cuboid that has two distinguished points - that is one of its vertexes ($A$) and the other one is somewhere on the surface ($B$).

There is an arbitrary point $X_B$ with coordinates $(a,b,c)$ if you take B as the origin. Now this cuboid gets moved (i.e. a translation and a rotation get applied), so that those two distinguished points on its surface are now at $A'$ and $B'$. The coordinates of $X$ for $B'$ being the origin can be calculated with a transformation matrix: $X_B' = M_B * X = (a', b', c')$

The same thing works for $A$ being the origin: $X_A = (e,f,g) \rightarrow X_A' = M_A * X_A$

Thing is: I know $M_B$ but not $M_A$ - but that is what I need to know. My feeling tells me that probably $M_A = M_B$, as the relationship between A and B stays the same. I've been trying to prove that or to find any other way to get $M_A$ out of $M_B$, but I couldn't find anything. Any help with this is highly appreciated!

-
How are the axes of the coordinate system aligned? I assume they're moving with the cuboid? – Generic Human Apr 15 '12 at 16:48
@GenericHuman The coordinate system with the origin in the vertex of that cuboid is defined by its edges. The other one is defined by a vector pointing inside the cuboid and two vectors on the surface. So yes, they are moving with the cuboid. But I can't tell exactly how they are aligned to each other. – Niko Apr 15 '12 at 17:05
In general $X_{B'}$ will be a function of $X_B$ that is affine but not linear, unless the transformation is such that $B=B'$ (indeed, let $X=B$, then $B_{B'}$ is necessarily 0). The same is true for $A$. So the only possible transformations would be rotations around axis $(AB)$. Is this really what you're interested in? – Generic Human Apr 15 '12 at 19:13
@GenericHuman The first thing is indeed true, those matrixes $M_A$ and $M_B$ consist of a rotation and a translation (they are homogeneous matrixes, to be specific). But what do you mean with "the only possible transformations would be rotations around axis"? – Niko Apr 15 '12 at 20:23

First if your matrices $M_A,M_B$ stand for a translation you should use vectors $(a,b,c,1)$ as indicated here: http://en.wikipedia.org/wiki/Affine_transformation#Representation .

I will first suppose only the origin of your affine frame is changed ($A$ or $B$), the vectors left unchanged.

As I understand the problem $X$ is considered fixed, only A and B move. Then $M_A$ and $M_B$ need not be equal. Consider for instance a rotation about a line passing through 1 or 2 vertices. If $A$ belongs to this axis of rotation it will be fixed and $M_A$ will be the identity, while if $B$ does not belong to the axis of rotation $M_B$ will not be the identity.

$M_A$ corresponds to summing $\overrightarrow{A'A}$. Similarly for $M_B$ so passing from $M_B$ to $M_A$ is summing $\overrightarrow{A'A}+\overrightarrow{BB'}$. You may subtract and change the order of letters accordingly.

Then if you also change the vectors of your affine frame (if they are taken to be the edges of your cuboid) you should do the same with the homogeneous (i.e. linear transformation) part of your matrices. $M_A$ will have translation part as indicated above but the linear part will be 3 column vectors $\overrightarrow{AP},\overrightarrow{AQ},\overrightarrow{AR}$ in the new basis ($\overrightarrow{A'P'},\overrightarrow{A'Q'},\overrightarrow{A'R'}$) if $P,Q,R$ are the points of the cuboid used to define the affine frame with A.

Finally $M_A$ is obtained from $M_B$ multiplying by $M_AM_B^{-1}$, as we did with translations of the origin on.

EDIT:

• "cube" $\rightarrow$ "cuboid" (though this could be an arbitrary parallelogram)
• "$M_AM_{B^{-1}}$" $\rightarrow$ "$M_AM_B^{-1}$"
-
Thank you! This was helpful to me. – Niko Apr 17 '12 at 19:17