Why do 2D transformations need 3x3 matrices?

瘦欲@ 提交于 2019-11-30 03:47:01

this is with multiplications of the matrices that we create our transformations

This is why we want square matrices.

Suppose we did what you propose, and used 2x3 matrices for our transformations.

Then a rotation would be

( x1, x2, 0 )
( y1, y2, 0 )

and a translation would be

( 1, 0, tx )
( 0, 1, ty )

and we could perform either rotations or translations by multiplying our matrix by a column vector representing the point:

    ( x )
M   ( y )
    ( 0 )

to get correct answers.

However - how would we go about composing transformations? Indeed, for your "for a rotation + translation I have a matrix like this" example, how did you get to that matrix? Sure, in this case you can just write it out, but in general? Well, you know the answer:

this is with multiplications of the matrices that we create our transformations

So it must be possible to multiply two transformation matrices to give another transformation matrix. And the rules of matrix multiplication show that this:

( . . . ) ( . . . )
( . . . ) ( . . . ) = ???

is not a valid matrix multiplcation. We need matrices that can be multipled in order for our transformations to be composable. So we have that extra row.


Now, the way I've expressed it here is in fact completely backward from the standard mathematical presentation, in which the familiar transformations of rotation and translation are just special cases of the full power of homogeneous coordinate transformations on the projective plane - but I think it will do to show you why we need that extra row - to make the matrix square, and thus able to be multipled with like matrices.

The answer is Homogeneous Coordinates. To combine rotation and translation in one operation one extra dimension is needed than the model requires. For planar things this is 3 components and for spatial things this is 4 components. The operators take 3 components and return 3 components requiring 3x3 matrices.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!