Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Usually affine transform matrix (in 2D) is represented like

enter image description here

where block A is responsible for linear transformation (no translation) and block B is responsible for translation.

Block D is always zero and block C is always one.

What if I put some values into blocks D and C I will affect only third (bottom) component of 2D vector, which should be always 1 and usually plays no role.

But can it? Are there some generalizations, where third component plays some role and consequently, bottom row of transform matrix also does?

And one more question: does this decomposition is actual only for 2D? Is it the same for 2D and xD?

share|cite|improve this question

Engineers (especially in the field of image processing and computer vision) used to represent an affine transformation in the stated form so that one can perform an affine transform using a single matrix-vector multiplication: $$ \begin{pmatrix}x'\\y'\\1\end{pmatrix} =\begin{pmatrix}a_{11}&a_{12}&t_1\\a_{21}&a_{22}&t_2\\0&0&1\end{pmatrix} \begin{pmatrix}x\\y\\1\end{pmatrix}. $$ Another merit of this representation is that you can compose two affine transformations using simply by multiplying their matrices together.

This representation obviously generalizes to higher dimensions as well, and it is a widely adopted convention to represent affine transformations in 2 or 3 dimensions in this way. Whether such a convention is good or not is a matter of taste, but engineers and computer scientists seem to think that this is convenient.

share|cite|improve this answer
But what about block D and C? – Suzan Cioc Mar 20 '13 at 16:24
@SuzanCioc What do you mean? $D$ remains a row of zeros and $C=1$ in all dimensions. – user1551 Mar 20 '13 at 17:09
What if I put non-zeros and non-ones there. This is the question. – Suzan Cioc Mar 20 '13 at 17:23
@SuzanCioc It's OK to put other entries in $C$ or $D$, as long as you do not compose affine transforms. Changing $C$ and $D$ will not change the results of $x'$ and $y'$. So, if all you need are only the $x,y$-coordinates of the outputs of a given affine transform, $C$ and $D$ don't play any roles in the calculation. However, if you do want to compose a number of affine transformations, you shall keep $C=0$ and $D=1$, or else a wrong result may be obtained. – user1551 Mar 20 '13 at 17:54

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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