# 2D Transformation Matrix

I have the 2D transformation A->B in the design below, with the homogeneous transformation matrix as the answer

As i understand there 2 transformations performed: a Rotation by 180 degrees and a Translation of 4 at X Axis

With the homogeneous Matrices

The transformation Matrix should be this:

Can someone explain what im i doing wrong?

• You are not performing a 180-degree rotation, but a reflection with respect to the $x$-axis. Commented Oct 22, 2015 at 7:22
• isnt this the reflection matrix for the x-axis? people.bath.ac.uk/sej20/images/2x2transform2.jpg Commented Oct 22, 2015 at 7:24
• @ahorn im using 3x3 matrix because of the Homogeneous coordinates. en.wikipedia.org/wiki/Homogeneous_coordinates Commented Oct 22, 2015 at 7:38

You are not performing a 180-degree rotation, but a reflection with respect to the $x$-axis. Thus, your matrix $A$ is correct, but $B$ is not. Try to use this one instead $$B=\left(\begin{array}{c} 1 & 0 & 0 \\ 0 & -1 & 0 \\ 0 & 0 & 1 \end{array}\right)$$ That way you will obtain the transpose of the answer you have. It seems that the answer matrix is given to perform transformations by post-multiplying, instead of the most usual pre-multiplication. In other words, a point $(x,y)$ will have coordinates $(x',y')$ such that $$\left(\begin{array}{c} x' & y' & 1 \end{array}\right) = \left(\begin{array}{c} x & y & 1 \end{array}\right)\left(\begin{array}{c} 1 & 0 & 0 \\ 0 & -1 & 0 \\ -4 & 0 & 1 \end{array}\right)$$

• Thank you for the explanation. Do you mind explaining why i dont get the correct answer matrix by multiplication of the given A and B matrices? unsee.cc/zobemipu Commented Oct 22, 2015 at 7:59
• Well, first of all you need to use the correct $B$—the one in AugSB’s answer. On top of that, as AugSB points out, the matrix in the given solution appears to be set up for post-multiplication, so it’ll be the transpose of the matrix you’re probably getting.
– amd
Commented Oct 22, 2015 at 9:13
• Ohhh now i get it! Thank you both Commented Oct 22, 2015 at 9:16