fbpx
Wikipedia

Transformation matrix

In linear algebra, linear transformations can be represented by matrices. If is a linear transformation mapping to and is a column vector with entries, then

for some matrix , called the transformation matrix of .[citation needed] Note that has rows and columns, whereas the transformation is from to . There are alternative expressions of transformation matrices involving row vectors that are preferred by some authors.[1][2]

Uses edit

Matrices allow arbitrary linear transformations to be displayed in a consistent format, suitable for computation.[3] This also allows transformations to be composed easily (by multiplying their matrices).

Linear transformations are not the only ones that can be represented by matrices. Some transformations that are non-linear on an n-dimensional Euclidean space Rn can be represented as linear transformations on the n+1-dimensional space Rn+1. These include both affine transformations (such as translation) and projective transformations. For this reason, 4×4 transformation matrices are widely used in 3D computer graphics. These n+1-dimensional transformation matrices are called, depending on their application, affine transformation matrices, projective transformation matrices, or more generally non-linear transformation matrices. With respect to an n-dimensional matrix, an n+1-dimensional matrix can be described as an augmented matrix.

In the physical sciences, an active transformation is one which actually changes the physical position of a system, and makes sense even in the absence of a coordinate system whereas a passive transformation is a change in the coordinate description of the physical system (change of basis). The distinction between active and passive transformations is important. By default, by transformation, mathematicians usually mean active transformations, while physicists could mean either.

Put differently, a passive transformation refers to description of the same object as viewed from two different coordinate frames.

Finding the matrix of a transformation edit

If one has a linear transformation   in functional form, it is easy to determine the transformation matrix A by transforming each of the vectors of the standard basis by T, then inserting the result into the columns of a matrix. In other words,

 

For example, the function   is a linear transformation. Applying the above process (suppose that n = 2 in this case) reveals that

 

The matrix representation of vectors and operators depends on the chosen basis; a similar matrix will result from an alternate basis. Nevertheless, the method to find the components remains the same.

To elaborate, vector   can be represented in basis vectors,   with coordinates  :

 

Now, express the result of the transformation matrix A upon  , in the given basis:

 

The   elements of matrix A are determined for a given basis E by applying A to every  , and observing the response vector

 

This equation defines the wanted elements,  , of j-th column of the matrix A.[4]

Eigenbasis and diagonal matrix edit

Yet, there is a special basis for an operator in which the components form a diagonal matrix and, thus, multiplication complexity reduces to n. Being diagonal means that all coefficients   except   are zeros leaving only one term in the sum   above. The surviving diagonal elements,  , are known as eigenvalues and designated with   in the defining equation, which reduces to  . The resulting equation is known as eigenvalue equation.[5] The eigenvectors and eigenvalues are derived from it via the characteristic polynomial.

With diagonalization, it is often possible to translate to and from eigenbases.

Examples in 2 dimensions edit

Most common geometric transformations that keep the origin fixed are linear, including rotation, scaling, shearing, reflection, and orthogonal projection; if an affine transformation is not a pure translation it keeps some point fixed, and that point can be chosen as origin to make the transformation linear. In two dimensions, linear transformations can be represented using a 2×2 transformation matrix.

Stretching edit

A stretch in the xy-plane is a linear transformation which enlarges all distances in a particular direction by a constant factor but does not affect distances in the perpendicular direction. We only consider stretches along the x-axis and y-axis. A stretch along the x-axis has the form x' = kx; y' = y for some positive constant k. (Note that if k > 1, then this really is a "stretch"; if k < 1, it is technically a "compression", but we still call it a stretch. Also, if k = 1, then the transformation is an identity, i.e. it has no effect.)

The matrix associated with a stretch by a factor k along the x-axis is given by:

 

Similarly, a stretch by a factor k along the y-axis has the form x' = x; y' = ky, so the matrix associated with this transformation is

 

Squeezing edit

If the two stretches above are combined with reciprocal values, then the transformation matrix represents a squeeze mapping:

 
A square with sides parallel to the axes is transformed to a rectangle that has the same area as the square. The reciprocal stretch and compression leave the area invariant.

Rotation edit

For rotation by an angle θ counterclockwise (positive direction) about the origin the functional form is   and  . Written in matrix form, this becomes:[6]

 

Similarly, for a rotation clockwise (negative direction) about the origin, the functional form is   and   the matrix form is:

 

These formulae assume that the x axis points right and the y axis points up.

Shearing edit

For shear mapping (visually similar to slanting), there are two possibilities.

A shear parallel to the x axis has   and  . Written in matrix form, this becomes:

 

A shear parallel to the y axis has   and  , which has matrix form:

 

Reflection edit

For reflection about a line that goes through the origin, let   be a vector in the direction of the line. Then use the transformation matrix:

 

Orthogonal projection edit

To project a vector orthogonally onto a line that goes through the origin, let   be a vector in the direction of the line. Then use the transformation matrix:

 

As with reflections, the orthogonal projection onto a line that does not pass through the origin is an affine, not linear, transformation.

Parallel projections are also linear transformations and can be represented simply by a matrix. However, perspective projections are not, and to represent these with a matrix, homogeneous coordinates can be used.

Examples in 3D computer graphics edit

Rotation edit

The matrix to rotate an angle θ about any axis defined by unit vector (x,y,z) is [7]

 

Reflection edit

To reflect a point through a plane   (which goes through the origin), one can use  , where   is the 3×3 identity matrix and   is the three-dimensional unit vector for the vector normal of the plane. If the L2 norm of  ,  , and   is unity, the transformation matrix can be expressed as:

 

Note that these are particular cases of a Householder reflection in two and three dimensions. A reflection about a line or plane that does not go through the origin is not a linear transformation — it is an affine transformation — as a 4×4 affine transformation matrix, it can be expressed as follows (assuming the normal is a unit vector):

 
where   for some point   on the plane, or equivalently,  .

If the 4th component of the vector is 0 instead of 1, then only the vector's direction is reflected and its magnitude remains unchanged, as if it were mirrored through a parallel plane that passes through the origin. This is a useful property as it allows the transformation of both positional vectors and normal vectors with the same matrix. See homogeneous coordinates and affine transformations below for further explanation.

Composing and inverting transformations edit

One of the main motivations for using matrices to represent linear transformations is that transformations can then be easily composed and inverted.

Composition is accomplished by matrix multiplication. Row and column vectors are operated upon by matrices, rows on the left and columns on the right. Since text reads from left to right, column vectors are preferred when transformation matrices are composed:

If A and B are the matrices of two linear transformations, then the effect of first applying A and then B to a column vector   is given by:

 

In other words, the matrix of the combined transformation A followed by B is simply the product of the individual matrices.

When A is an invertible matrix there is a matrix A−1 that represents a transformation that "undoes" A since its composition with A is the identity matrix. In some practical applications, inversion can be computed using general inversion algorithms or by performing inverse operations (that have obvious geometric interpretation, like rotating in opposite direction) and then composing them in reverse order. Reflection matrices are a special case because they are their own inverses and don't need to be separately calculated.

When composing linear transformations, it is possible to create a shear/skew by composing a rotation matrix A followed by a non-uniform scale matrix B. Therefore, if shear/skew is not desired, non-uniform scale must also be disallowed in order to prevent a shear/skew from appearing as the result of composition. Linear transformations with this property are known as conformal linear transformations because they are also conformal maps.

Other kinds of transformations edit

Affine transformations edit

 
Effect of applying various 2D affine transformation matrices on a unit square. Note that the reflection matrices are special cases of the scaling matrix.
Affine transformations on the 2D plane can be performed in three dimensions. Translation is done by shearing parallel to the xy plane, and rotation is performed around the z axis.

To represent affine transformations with matrices, we can use homogeneous coordinates. This means representing a 2-vector (x, y) as a 3-vector (x, y, 1), and similarly for higher dimensions. Using this system, translation can be expressed with matrix multiplication. The functional form   becomes:

 

All ordinary linear transformations are included in the set of affine transformations, and can be described as a simplified form of affine transformations. Therefore, any linear transformation can also be represented by a general transformation matrix. The latter is obtained by expanding the corresponding linear transformation matrix by one row and column, filling the extra space with zeros except for the lower-right corner, which must be set to 1. For example, the counter-clockwise rotation matrix from above becomes:

 

Using transformation matrices containing homogeneous coordinates, translations become linear, and thus can be seamlessly intermixed with all other types of transformations. The reason is that the real plane is mapped to the w = 1 plane in real projective space, and so translation in real Euclidean space can be represented as a shear in real projective space. Although a translation is a non-linear transformation in a 2-D or 3-D Euclidean space described by Cartesian coordinates (i.e. it can't be combined with other transformations while preserving commutativity and other properties), it becomes, in a 3-D or 4-D projective space described by homogeneous coordinates, a simple linear transformation (a shear).

More affine transformations can be obtained by composition of two or more affine transformations. For example, given a translation T' with vector   a rotation R by an angle θ counter-clockwise, a scaling S with factors   and a translation T of vector   the result M of T'RST is:[8]

 

When using affine transformations, the homogeneous component of a coordinate vector (normally called w) will never be altered. One can therefore safely assume that it is always 1 and ignore it. However, this is not true when using perspective projections.

Perspective projection edit

 
Comparison of the effects of applying 2D affine and perspective transformation matrices on a unit square.

Another type of transformation, of importance in 3D computer graphics, is the perspective projection. Whereas parallel projections are used to project points onto the image plane along parallel lines, the perspective projection projects points onto the image plane along lines that emanate from a single point, called the center of projection. This means that an object has a smaller projection when it is far away from the center of projection and a larger projection when it is closer (see also reciprocal function).

The simplest perspective projection uses the origin as the center of projection, and the plane at   as the image plane. The functional form of this transformation is then  ;  . We can express this in homogeneous coordinates as:

 

After carrying out the matrix multiplication, the homogeneous component   will be equal to the value of   and the other three will not change. Therefore, to map back into the real plane we must perform the homogeneous divide or perspective divide by dividing each component by  :

 

More complicated perspective projections can be composed by combining this one with rotations, scales, translations, and shears to move the image plane and center of projection wherever they are desired.

See also edit

References edit

  1. ^ Rafael Artzy (1965) Linear Geometry
  2. ^ J. W. P. Hirschfeld (1979) Projective Geometry of Finite Fields, Clarendon Press
  3. ^ Gentle, James E. (2007). "Matrix Transformations and Factorizations". Matrix Algebra: Theory, Computations, and Applications in Statistics. Springer. ISBN 9780387708737.
  4. ^ Nearing, James (2010). "Chapter 7.3 Examples of Operators" (PDF). Mathematical Tools for Physics. ISBN 978-0486482125. Retrieved January 1, 2012.
  5. ^ Nearing, James (2010). "Chapter 7.9: Eigenvalues and Eigenvectors" (PDF). Mathematical Tools for Physics. ISBN 978-0486482125. Retrieved January 1, 2012.
  6. ^ http://ocw.mit.edu/courses/aeronautics-and-astronautics/16-07-dynamics-fall-2009/lecture-notes/MIT16_07F09_Lec03.pdf[bare URL PDF]
  7. ^ Szymanski, John E. (1989). Basic Mathematics for Electronic Engineers:Models and Applications. Taylor & Francis. p. 154. ISBN 0278000681.
  8. ^ Cédric Jules (February 25, 2015). "2D transformation matrices baking".

External links edit

  • Practical examples in POV-Ray
  • Reference page - Rotation of axes
  • Linear Transformation Calculator
  • Transformation Applet - Generate matrices from 2D transformations and vice versa.
  • Coordinate transformation under rotation in 2D

transformation, matrix, linear, algebra, linear, transformations, represented, matrices, displaystyle, linear, transformation, mapping, displaystyle, mathbb, displaystyle, mathbb, displaystyle, mathbf, column, vector, with, displaystyle, entries, thent, displa. In linear algebra linear transformations can be represented by matrices If T displaystyle T is a linear transformation mapping R n displaystyle mathbb R n to R m displaystyle mathbb R m and x displaystyle mathbf x is a column vector with n displaystyle n entries thenT x A x displaystyle T mathbf x A mathbf x for some m n displaystyle m times n matrix A displaystyle A called the transformation matrix of T displaystyle T citation needed Note that A displaystyle A has m displaystyle m rows and n displaystyle n columns whereas the transformation T displaystyle T is from R n displaystyle mathbb R n to R m displaystyle mathbb R m There are alternative expressions of transformation matrices involving row vectors that are preferred by some authors 1 2 Contents 1 Uses 2 Finding the matrix of a transformation 2 1 Eigenbasis and diagonal matrix 3 Examples in 2 dimensions 3 1 Stretching 3 2 Squeezing 3 3 Rotation 3 4 Shearing 3 5 Reflection 3 6 Orthogonal projection 4 Examples in 3D computer graphics 4 1 Rotation 4 2 Reflection 5 Composing and inverting transformations 6 Other kinds of transformations 6 1 Affine transformations 6 2 Perspective projection 7 See also 8 References 9 External linksUses editMatrices allow arbitrary linear transformations to be displayed in a consistent format suitable for computation 3 This also allows transformations to be composed easily by multiplying their matrices Linear transformations are not the only ones that can be represented by matrices Some transformations that are non linear on an n dimensional Euclidean space Rn can be represented as linear transformations on the n 1 dimensional space Rn 1 These include both affine transformations such as translation and projective transformations For this reason 4 4 transformation matrices are widely used in 3D computer graphics These n 1 dimensional transformation matrices are called depending on their application affine transformation matrices projective transformation matrices or more generally non linear transformation matrices With respect to an n dimensional matrix an n 1 dimensional matrix can be described as an augmented matrix In the physical sciences an active transformation is one which actually changes the physical position of a system and makes sense even in the absence of a coordinate system whereas a passive transformation is a change in the coordinate description of the physical system change of basis The distinction between active and passive transformations is important By default by transformation mathematicians usually mean active transformations while physicists could mean either Put differently a passive transformation refers to description of the same object as viewed from two different coordinate frames Finding the matrix of a transformation editIf one has a linear transformation T x displaystyle T x nbsp in functional form it is easy to determine the transformation matrix A by transforming each of the vectors of the standard basis by T then inserting the result into the columns of a matrix In other words A T e 1 T e 2 T e n displaystyle A begin bmatrix T mathbf e 1 amp T mathbf e 2 amp cdots amp T mathbf e n end bmatrix nbsp For example the function T x 5 x displaystyle T x 5x nbsp is a linear transformation Applying the above process suppose that n 2 in this case reveals thatT x 5 x 5 I x 5 0 0 5 x displaystyle T mathbf x 5 mathbf x 5I mathbf x begin bmatrix 5 amp 0 0 amp 5 end bmatrix mathbf x nbsp The matrix representation of vectors and operators depends on the chosen basis a similar matrix will result from an alternate basis Nevertheless the method to find the components remains the same To elaborate vector v displaystyle mathbf v nbsp can be represented in basis vectors E e 1 e 2 e n displaystyle E begin bmatrix mathbf e 1 amp mathbf e 2 amp cdots amp mathbf e n end bmatrix nbsp with coordinates v E v 1 v 2 v n T displaystyle mathbf v E begin bmatrix v 1 amp v 2 amp cdots amp v n end bmatrix mathrm T nbsp v v 1 e 1 v 2 e 2 v n e n i v i e i E v E displaystyle mathbf v v 1 mathbf e 1 v 2 mathbf e 2 cdots v n mathbf e n sum i v i mathbf e i E mathbf v E nbsp Now express the result of the transformation matrix A upon v displaystyle mathbf v nbsp in the given basis A v A i v i e i i v i A e i A e 1 A e 2 A e n v E A v E e 1 e 2 e n a 1 1 a 1 2 a 1 n a 2 1 a 2 2 a 2 n a n 1 a n 2 a n n v 1 v 2 v n displaystyle begin aligned A mathbf v amp A left sum i v i mathbf e i right sum i v i A mathbf e i amp begin bmatrix A mathbf e 1 amp A mathbf e 2 amp cdots amp A mathbf e n end bmatrix mathbf v E A cdot mathbf v E 3pt amp begin bmatrix mathbf e 1 amp mathbf e 2 amp cdots amp mathbf e n end bmatrix begin bmatrix a 1 1 amp a 1 2 amp cdots amp a 1 n a 2 1 amp a 2 2 amp cdots amp a 2 n vdots amp vdots amp ddots amp vdots a n 1 amp a n 2 amp cdots amp a n n end bmatrix begin bmatrix v 1 v 2 vdots v n end bmatrix end aligned nbsp The a i j displaystyle a i j nbsp elements of matrix A are determined for a given basis E by applying A to every e j 0 0 v j 1 0 T displaystyle mathbf e j begin bmatrix 0 amp 0 amp cdots amp v j 1 amp cdots amp 0 end bmatrix mathrm T nbsp and observing the response vectorA e j a 1 j e 1 a 2 j e 2 a n j e n i a i j e i displaystyle A mathbf e j a 1 j mathbf e 1 a 2 j mathbf e 2 cdots a n j mathbf e n sum i a i j mathbf e i nbsp This equation defines the wanted elements a i j displaystyle a i j nbsp of j th column of the matrix A 4 Eigenbasis and diagonal matrix edit Main articles Diagonal matrix and Eigenvalues and eigenvectors Yet there is a special basis for an operator in which the components form a diagonal matrix and thus multiplication complexity reduces to n Being diagonal means that all coefficients a i j displaystyle a i j nbsp except a i i displaystyle a i i nbsp are zeros leaving only one term in the sum a i j e i textstyle sum a i j mathbf e i nbsp above The surviving diagonal elements a i i displaystyle a i i nbsp are known as eigenvalues and designated with l i displaystyle lambda i nbsp in the defining equation which reduces to A e i l i e i displaystyle A mathbf e i lambda i mathbf e i nbsp The resulting equation is known as eigenvalue equation 5 The eigenvectors and eigenvalues are derived from it via the characteristic polynomial With diagonalization it is often possible to translate to and from eigenbases Examples in 2 dimensions editMost common geometric transformations that keep the origin fixed are linear including rotation scaling shearing reflection and orthogonal projection if an affine transformation is not a pure translation it keeps some point fixed and that point can be chosen as origin to make the transformation linear In two dimensions linear transformations can be represented using a 2 2 transformation matrix Stretching edit A stretch in the xy plane is a linear transformation which enlarges all distances in a particular direction by a constant factor but does not affect distances in the perpendicular direction We only consider stretches along the x axis and y axis A stretch along the x axis has the form x kx y y for some positive constant k Note that if k gt 1 then this really is a stretch if k lt 1 it is technically a compression but we still call it a stretch Also if k 1 then the transformation is an identity i e it has no effect The matrix associated with a stretch by a factor k along the x axis is given by k 0 0 1 displaystyle begin bmatrix k amp 0 0 amp 1 end bmatrix nbsp Similarly a stretch by a factor k along the y axis has the form x x y ky so the matrix associated with this transformation is 1 0 0 k displaystyle begin bmatrix 1 amp 0 0 amp k end bmatrix nbsp Squeezing edit If the two stretches above are combined with reciprocal values then the transformation matrix represents a squeeze mapping k 0 0 1 k displaystyle begin bmatrix k amp 0 0 amp 1 k end bmatrix nbsp A square with sides parallel to the axes is transformed to a rectangle that has the same area as the square The reciprocal stretch and compression leave the area invariant Rotation edit For rotation by an angle 8 counterclockwise positive direction about the origin the functional form is x x cos 8 y sin 8 displaystyle x x cos theta y sin theta nbsp and y x sin 8 y cos 8 displaystyle y x sin theta y cos theta nbsp Written in matrix form this becomes 6 x y cos 8 sin 8 sin 8 cos 8 x y displaystyle begin bmatrix x y end bmatrix begin bmatrix cos theta amp sin theta sin theta amp cos theta end bmatrix begin bmatrix x y end bmatrix nbsp Similarly for a rotation clockwise negative direction about the origin the functional form is x x cos 8 y sin 8 displaystyle x x cos theta y sin theta nbsp and y x sin 8 y cos 8 displaystyle y x sin theta y cos theta nbsp the matrix form is x y cos 8 sin 8 sin 8 cos 8 x y displaystyle begin bmatrix x y end bmatrix begin bmatrix cos theta amp sin theta sin theta amp cos theta end bmatrix begin bmatrix x y end bmatrix nbsp These formulae assume that the x axis points right and the y axis points up Shearing edit For shear mapping visually similar to slanting there are two possibilities A shear parallel to the x axis has x x k y displaystyle x x ky nbsp and y y displaystyle y y nbsp Written in matrix form this becomes x y 1 k 0 1 x y displaystyle begin bmatrix x y end bmatrix begin bmatrix 1 amp k 0 amp 1 end bmatrix begin bmatrix x y end bmatrix nbsp A shear parallel to the y axis has x x displaystyle x x nbsp and y y k x displaystyle y y kx nbsp which has matrix form x y 1 0 k 1 x y displaystyle begin bmatrix x y end bmatrix begin bmatrix 1 amp 0 k amp 1 end bmatrix begin bmatrix x y end bmatrix nbsp Reflection edit Main article Householder transformation For reflection about a line that goes through the origin let l l x l y displaystyle mathbf l l x l y nbsp be a vector in the direction of the line Then use the transformation matrix A 1 l 2 l x 2 l y 2 2 l x l y 2 l x l y l y 2 l x 2 displaystyle mathbf A frac 1 lVert mathbf l rVert 2 begin bmatrix l x 2 l y 2 amp 2l x l y 2l x l y amp l y 2 l x 2 end bmatrix nbsp Orthogonal projection edit Further information Orthogonal projection To project a vector orthogonally onto a line that goes through the origin let u u x u y displaystyle mathbf u u x u y nbsp be a vector in the direction of the line Then use the transformation matrix A 1 u 2 u x 2 u x u y u x u y u y 2 displaystyle mathbf A frac 1 lVert mathbf u rVert 2 begin bmatrix u x 2 amp u x u y u x u y amp u y 2 end bmatrix nbsp As with reflections the orthogonal projection onto a line that does not pass through the origin is an affine not linear transformation Parallel projections are also linear transformations and can be represented simply by a matrix However perspective projections are not and to represent these with a matrix homogeneous coordinates can be used Examples in 3D computer graphics editRotation edit The matrix to rotate an angle 8 about any axis defined by unit vector x y z is 7 x x 1 cos 8 cos 8 y x 1 cos 8 z sin 8 z x 1 cos 8 y sin 8 x y 1 cos 8 z sin 8 y y 1 cos 8 cos 8 z y 1 cos 8 x sin 8 x z 1 cos 8 y sin 8 y z 1 cos 8 x sin 8 z z 1 cos 8 cos 8 displaystyle begin bmatrix xx 1 cos theta cos theta amp yx 1 cos theta z sin theta amp zx 1 cos theta y sin theta xy 1 cos theta z sin theta amp yy 1 cos theta cos theta amp zy 1 cos theta x sin theta xz 1 cos theta y sin theta amp yz 1 cos theta x sin theta amp zz 1 cos theta cos theta end bmatrix nbsp Reflection edit Main article Householder transformation To reflect a point through a plane a x b y c z 0 displaystyle ax by cz 0 nbsp which goes through the origin one can use A I 2 N N T displaystyle mathbf A mathbf I 2 mathbf NN mathrm T nbsp where I displaystyle mathbf I nbsp is the 3 3 identity matrix and N displaystyle mathbf N nbsp is the three dimensional unit vector for the vector normal of the plane If the L2 norm of a displaystyle a nbsp b displaystyle b nbsp and c displaystyle c nbsp is unity the transformation matrix can be expressed as A 1 2 a 2 2 a b 2 a c 2 a b 1 2 b 2 2 b c 2 a c 2 b c 1 2 c 2 displaystyle mathbf A begin bmatrix 1 2a 2 amp 2ab amp 2ac 2ab amp 1 2b 2 amp 2bc 2ac amp 2bc amp 1 2c 2 end bmatrix nbsp Note that these are particular cases of a Householder reflection in two and three dimensions A reflection about a line or plane that does not go through the origin is not a linear transformation it is an affine transformation as a 4 4 affine transformation matrix it can be expressed as follows assuming the normal is a unit vector x y z 1 1 2 a 2 2 a b 2 a c 2 a d 2 a b 1 2 b 2 2 b c 2 b d 2 a c 2 b c 1 2 c 2 2 c d 0 0 0 1 x y z 1 displaystyle begin bmatrix x y z 1 end bmatrix begin bmatrix 1 2a 2 amp 2ab amp 2ac amp 2ad 2ab amp 1 2b 2 amp 2bc amp 2bd 2ac amp 2bc amp 1 2c 2 amp 2cd 0 amp 0 amp 0 amp 1 end bmatrix begin bmatrix x y z 1 end bmatrix nbsp where d p N displaystyle d mathbf p cdot mathbf N nbsp for some point p displaystyle mathbf p nbsp on the plane or equivalently a x b y c z d 0 displaystyle ax by cz d 0 nbsp If the 4th component of the vector is 0 instead of 1 then only the vector s direction is reflected and its magnitude remains unchanged as if it were mirrored through a parallel plane that passes through the origin This is a useful property as it allows the transformation of both positional vectors and normal vectors with the same matrix See homogeneous coordinates and affine transformations below for further explanation Composing and inverting transformations editOne of the main motivations for using matrices to represent linear transformations is that transformations can then be easily composed and inverted Composition is accomplished by matrix multiplication Row and column vectors are operated upon by matrices rows on the left and columns on the right Since text reads from left to right column vectors are preferred when transformation matrices are composed If A and B are the matrices of two linear transformations then the effect of first applying A and then B to a column vector x displaystyle mathbf x nbsp is given by B A x B A x displaystyle mathbf B mathbf A mathbf x mathbf BA mathbf x nbsp In other words the matrix of the combined transformation A followed by B is simply the product of the individual matrices When A is an invertible matrix there is a matrix A 1 that represents a transformation that undoes A since its composition with A is the identity matrix In some practical applications inversion can be computed using general inversion algorithms or by performing inverse operations that have obvious geometric interpretation like rotating in opposite direction and then composing them in reverse order Reflection matrices are a special case because they are their own inverses and don t need to be separately calculated When composing linear transformations it is possible to create a shear skew by composing a rotation matrix A followed by a non uniform scale matrix B Therefore if shear skew is not desired non uniform scale must also be disallowed in order to prevent a shear skew from appearing as the result of composition Linear transformations with this property are known as conformal linear transformations because they are also conformal maps Other kinds of transformations editAffine transformations edit nbsp Effect of applying various 2D affine transformation matrices on a unit square Note that the reflection matrices are special cases of the scaling matrix source source source source source source Affine transformations on the 2D plane can be performed in three dimensions Translation is done by shearing parallel to the xy plane and rotation is performed around the z axis To represent affine transformations with matrices we can use homogeneous coordinates This means representing a 2 vector x y as a 3 vector x y 1 and similarly for higher dimensions Using this system translation can be expressed with matrix multiplication The functional form x x t x y y t y displaystyle x x t x y y t y nbsp becomes x y 1 1 0 t x 0 1 t y 0 0 1 x y 1 displaystyle begin bmatrix x y 1 end bmatrix begin bmatrix 1 amp 0 amp t x 0 amp 1 amp t y 0 amp 0 amp 1 end bmatrix begin bmatrix x y 1 end bmatrix nbsp All ordinary linear transformations are included in the set of affine transformations and can be described as a simplified form of affine transformations Therefore any linear transformation can also be represented by a general transformation matrix The latter is obtained by expanding the corresponding linear transformation matrix by one row and column filling the extra space with zeros except for the lower right corner which must be set to 1 For example the counter clockwise rotation matrix from above becomes cos 8 sin 8 0 sin 8 cos 8 0 0 0 1 displaystyle begin bmatrix cos theta amp sin theta amp 0 sin theta amp cos theta amp 0 0 amp 0 amp 1 end bmatrix nbsp Using transformation matrices containing homogeneous coordinates translations become linear and thus can be seamlessly intermixed with all other types of transformations The reason is that the real plane is mapped to the w 1 plane in real projective space and so translation in real Euclidean space can be represented as a shear in real projective space Although a translation is a non linear transformation in a 2 D or 3 D Euclidean space described by Cartesian coordinates i e it can t be combined with other transformations while preserving commutativity and other properties it becomes in a 3 D or 4 D projective space described by homogeneous coordinates a simple linear transformation a shear More affine transformations can be obtained by composition of two or more affine transformations For example given a translation T with vector t x t y displaystyle t x t y nbsp a rotation R by an angle 8 counter clockwise a scaling S with factors s x s y displaystyle s x s y nbsp and a translation T of vector t x t y displaystyle t x t y nbsp the result M of T RST is 8 s x cos 8 s y sin 8 t x s x cos 8 t y s y sin 8 t x s x sin 8 s y cos 8 t x s x sin 8 t y s y cos 8 t y 0 0 1 displaystyle begin bmatrix s x cos theta amp s y sin theta amp t x s x cos theta t y s y sin theta t x s x sin theta amp s y cos theta amp t x s x sin theta t y s y cos theta t y 0 amp 0 amp 1 end bmatrix nbsp When using affine transformations the homogeneous component of a coordinate vector normally called w will never be altered One can therefore safely assume that it is always 1 and ignore it However this is not true when using perspective projections Perspective projection edit Main article Perspective projection Further information Pinhole camera model nbsp Comparison of the effects of applying 2D affine and perspective transformation matrices on a unit square Another type of transformation of importance in 3D computer graphics is the perspective projection Whereas parallel projections are used to project points onto the image plane along parallel lines the perspective projection projects points onto the image plane along lines that emanate from a single point called the center of projection This means that an object has a smaller projection when it is far away from the center of projection and a larger projection when it is closer see also reciprocal function The simplest perspective projection uses the origin as the center of projection and the plane at z 1 displaystyle z 1 nbsp as the image plane The functional form of this transformation is then x x z displaystyle x x z nbsp y y z displaystyle y y z nbsp We can express this in homogeneous coordinates as x c y c z c w c 1 0 0 0 0 1 0 0 0 0 1 0 0 0 1 0 x y z 1 displaystyle begin bmatrix x c y c z c w c end bmatrix begin bmatrix 1 amp 0 amp 0 amp 0 0 amp 1 amp 0 amp 0 0 amp 0 amp 1 amp 0 0 amp 0 amp 1 amp 0 end bmatrix begin bmatrix x y z 1 end bmatrix nbsp After carrying out the matrix multiplication the homogeneous component w c displaystyle w c nbsp will be equal to the value of z displaystyle z nbsp and the other three will not change Therefore to map back into the real plane we must perform the homogeneous divide or perspective divide by dividing each component by w c displaystyle w c nbsp x y z 1 1 w c x c y c z c w c displaystyle begin bmatrix x y z 1 end bmatrix frac 1 w c begin bmatrix x c y c z c w c end bmatrix nbsp More complicated perspective projections can be composed by combining this one with rotations scales translations and shears to move the image plane and center of projection wherever they are desired See also edit3D projection Change of basis Image rectification Pose computer vision Rigid transformation Transformation function Transformation geometryReferences edit Rafael Artzy 1965 Linear Geometry J W P Hirschfeld 1979 Projective Geometry of Finite Fields Clarendon Press Gentle James E 2007 Matrix Transformations and Factorizations Matrix Algebra Theory Computations and Applications in Statistics Springer ISBN 9780387708737 Nearing James 2010 Chapter 7 3 Examples of Operators PDF Mathematical Tools for Physics ISBN 978 0486482125 Retrieved January 1 2012 Nearing James 2010 Chapter 7 9 Eigenvalues and Eigenvectors PDF Mathematical Tools for Physics ISBN 978 0486482125 Retrieved January 1 2012 http ocw mit edu courses aeronautics and astronautics 16 07 dynamics fall 2009 lecture notes MIT16 07F09 Lec03 pdf bare URL PDF Szymanski John E 1989 Basic Mathematics for Electronic Engineers Models and Applications Taylor amp Francis p 154 ISBN 0278000681 Cedric Jules February 25 2015 2D transformation matrices baking External links editThe Matrix Page Practical examples in POV Ray Reference page Rotation of axes Linear Transformation Calculator Transformation Applet Generate matrices from 2D transformations and vice versa Coordinate transformation under rotation in 2D Excel Fun Build 3D graphics from a spreadsheet Retrieved from https en wikipedia org w index php title Transformation matrix amp oldid 1167250701 Examples in 3D computer graphics, wikipedia, wiki, book, books, library,

article

, read, download, free, free download, mp3, video, mp4, 3gp, jpg, jpeg, gif, png, picture, music, song, movie, book, game, games.