FACTOID # 74: More than a third of the time, Icelanders don't show up for work. Perhaps that's why they're the world's happiest nation.
 
 Home   Encyclopedia   Statistics   Countries A-Z   Flags   Maps   Education   Forum   FAQ   About 
 
WHAT'S NEW
RECENT ARTICLES
More Recent Articles »
 

SEARCH ALL

FACTS & STATISTICS    Advanced view

Search encyclopedia, statistics and forums:

 

 

(* = Graphable)

 

 


Encyclopedia > Transformation matrix

In linear algebra, linear transformations can be represented by matrices. If T is a linear transformation mapping Rn to Rm and x is a column vector with n entries, then Linear algebra is the branch of mathematics concerned with the study of vectors, vector spaces (also called linear spaces), linear maps (also called linear transformations), and systems of linear equations. ... In mathematics, a linear transformation (also called linear map or linear operator) is a function between two vector spaces that preserves the operations of vector addition and scalar multiplication. ... For the square matrix section, see square matrix. ... In linear algebra, a column vector is an m × 1 matrix, i. ...

T( vec x ) = mathbf{A} vec x

for some m×n matrix A, called the transformation matrix of T.

Contents

Uses

Matrices allow arbitrary linear transformations to be represented in a consistent format, suitable for computation. This also allows transformations to be concatenated easily (by multiplying their matrices).


Linear transformations are not the only ones that can be represented by matrices. Using homogeneous coordinates, both affine transformations and perspective projections on Rn can be represented as linear transformations on RPn+1 (that is, n+1-dimensional real projective space). For this reason, 4x4 transformation matrices are widely used in 3D computer graphics. In mathematics, homogeneous coordinates, introduced by August Ferdinand Möbius, allow affine transformations to be easily represented by a matrix. ... In geometry, an affine transformation or affine map (from the Latin, affinis, connected with) between two vector spaces (strictly speaking, two affine spaces) consists of a linear transformation followed by a translation: In the finite-dimensional case each affine transformation is given by a matrix A and a vector b... Perspective projection is a type of drawing that graphically approximates on a planar (two-dimensional) surface (e. ... In mathematics, real projective space, or RPn is the projective space of lines in Rn+1. ... This article is about process of creating 3D computer graphics. ...


3-by-3 or 4-by-4 transformation matrices containing homogeneous coordinates are often called, somewhat improperly, "homogeneous transformation matrices". However, the transformations they represent are, in most cases, definitely non-homogeneous and non-linear (like translation, roto-translation or perspective projection). And even the matrices themselves look rather heterogeneous, i.e. composed of different kinds of elements (see below). Since they are multi-purpose transformation matrices, capable of representing both affine and projective transformations, they might be called "general transformation matrices", or, depending on the application, "affine transformation" or "perspective projection" matrices. Moreover, since the homogeneous coordinates describe a projective vector space, they can also be called "projective space transformation matrices". In mathematics, homogeneous may refer to: a homogeneous polynomial, in algebra a homogeneous function a homogeneous differential equation a homogeneous system of linear equations, in linear algebra homogeneous coordinates a homogeneous number a homogeneous space for a Lie group G, or more general transformation group a homogeneous ideal in a... For other uses, see Linear (disambiguation). ...


Finding the matrix of a transformation

If one has a linear transformation T(x) in functional form, it is easy to determine the transformation matrix A by simply transforming each of the vectors of the standard basis by T and then inserting the results into the columns of a matrix. In other words, In linear algebra, the standard basis for an -dimensional vector space is the basis obtained by taking the basis vectors where is the vector with a in the th coordinate and elsewhere. ...

mathbf{A} = begin{bmatrix} T( vec e_1 ) & T( vec e_2 ) & cdots & T( vec e_n ) end{bmatrix}

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

T( vec x ) = 5 vec x = begin{bmatrix} 5 && 0  0 && 5 end{bmatrix} vec x

Examples in 2D graphics

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.


Rotation

For rotation by an angle θ counterclockwise about the origin, the functional form is x' = xcosθ − ysinθ and y' = xsinθ + ycosθ. Written in matrix form, this becomes : In linear algebra and geometry, a coordinate rotation is a type of transformation from one system of coordinates to another system of coordinates such that distance between any two points remains invariant under the transformation. ...

 begin{bmatrix} x'  y' end{bmatrix} = begin{bmatrix} cos theta & - sintheta  sin theta & cos theta end{bmatrix} begin{bmatrix} x  y end{bmatrix}

Scaling

For scaling (that is, enlarging or shrinking), we have x' = s_x cdot x and y' = s_y cdot y. The matrix form is: In Euclidean geometry, uniform scaling is a linear transformation that enlarges or diminishes objects; the scale factor is the same in all directions; it is also called a homothety. ...

 begin{bmatrix} x'  y' end{bmatrix} = begin{bmatrix} s_x & 0  0 & s_y end{bmatrix} begin{bmatrix} x  y end{bmatrix}

Shearing

For shear mapping (visually similar to slanting), there are two possibilities. For a shear parallel to the x axis has x' = x + ky and y' = y; the shear matrix, applied to column vectors, is: In this shear transformation of an image of the Mona Lisa, the picture was deformed in such a way that its central vertical axis was not modified. ... In mathematics, a shear matrix is an elementary matrix that represents the addition of a multiple of one row or column to another. ... In linear algebra, a column vector is an m × 1 matrix, i. ...

 begin{bmatrix} x'  y' end{bmatrix} = begin{bmatrix} 1 & k  0 & 1 end{bmatrix} begin{bmatrix} x  y end{bmatrix}

A shear parallel to the y axis has x' = x and y' = y + kx, which has matrix form:

 begin{bmatrix} x'  y' end{bmatrix} = begin{bmatrix} 1 & 0  k & 1 end{bmatrix} begin{bmatrix} x  y end{bmatrix}

Reflection

To reflect a vector about a line that goes through the origin, let (lx, ly) be a vector in the direction of the line: This article is about vectors that have a particular relation to the spatial coordinates. ...

 mathbf{A} = frac{1}{l_x^2 + l_y^2} begin{bmatrix} l_x^2 - l_y^2 & 2 l_x l_y  2 l_x l_y & l_y^2 - l_x^2 end{bmatrix}

A reflection about a line that does not go through the origin is not a linear transformation; it is an affine transformation.


To reflect a point through a plane ax + by + cz = 0 you can use the equation I − 2NNT. Where I is the identity matrix and N is the unit vector for the surface normal of the plane. The transformation matrix received will be: In mathematics, a unit vector in a normed vector space is a vector (often a spatial vector) whose length, (or magnitude) is 1. ...


 begin{bmatrix} 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 - 2c^2 end{bmatrix}


Note that this technique only works if the plane runs through the origin: if it does not, an affine transformation is required. In geometry, an affine transformation or affine map (from the Latin, affinis, connected with) between two vector spaces (strictly speaking, two affine spaces) consists of a linear transformation followed by a translation: In the finite-dimensional case each affine transformation is given by a matrix A and a vector b...


Orthogonal projection

To project a vector orthogonally onto a line that goes through the origin, let (ux, uy) be a vector in the direction of the line. Then use the transformation matrix: This article is about vectors that have a particular relation to the spatial coordinates. ...

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 must be used. The transformation P is the orthogonal projection onto the line m. ...


Composing and inverting transformations

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


Composition is accomplished by matrix multiplication. If A and B are the matrices of two linear transformations, then the effect of applying first A and then B to a vector x is given by: This article gives an overview of the various ways to perform matrix multiplication. ...

mathbf{B}(mathbf{A} vec x ) = (mathbf{BA}) vec x

In other words, the matrix of the combined transformation A followed by B is simply the product of the individual matrices. Note that the multiplication is done in the opposite order from the English sentence: the matrix of "A followed by B" is BA, not AB.


A consequence of the ability to compose transformations by multiplying their matrices is that transformations can also be inverted by simply inverting their matrices. So, A-1 represents the transformation that "undoes" A. In linear algebra, an n-by-n (square) matrix A is called invertible or non-singular if there exists an n-by-n matrix B such that where In denotes the n-by-n identity matrix and the multiplication used is ordinary matrix multiplication. ...


Other kinds of transformations

Affine transformations

To represent affine transformations with matrices, we must 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 + tx; y' = y + ty becomes: In geometry, an affine transformation or affine map (from the Latin, affinis, connected with) between two vector spaces (strictly speaking, two affine spaces) consists of a linear transformation followed by a translation: In the finite-dimensional case each affine transformation is given by a matrix A and a vector b... In mathematics, homogeneous coordinates, introduced by August Ferdinand Möbius, allow affine transformations to be easily represented by a matrix. ...

 begin{bmatrix} x'  y'  1 end{bmatrix} = begin{bmatrix} 1 & 0 & t_x  0 & 1 & t_y  0 & 0 & 1 end{bmatrix} begin{bmatrix} x  y  1 end{bmatrix}


All ordinary linear transformations are included in the set of affine transformations, and can be described as a simplified form of affine transformations. Hence, any linear transformation can be also 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 rotation matrix from above becomes:

begin{bmatrix} cos theta & - sin theta & 0  sin theta & cos theta & 0  0 & 0 & 1 end{bmatrix}

Using transformation matrices containing homogeneous coordinates, translations 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, it becomes, in a 3-D or 4-D projective space described by homogeneous coordinates, a simple linear transformation (a shear). Around 300 BC, the Greek mathematician Euclid laid down the rules of what has now come to be called Euclidean geometry, which is the study of the relationships between angles and distances in space. ...


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

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. This article is about process of creating 3D computer graphics. ... Perspective projection is a type of drawing that graphically approximates on a planar (two-dimensional) surface (e. ...


The simplest perspective projection uses the origin as the center of projection, and z = 1 as the image plane. The functional form of this transformation is then x' = x / z; y' = y / z. We can express this in homogeneous coordinates as:

 begin{bmatrix} x_c  y_c  z_c  w_c end{bmatrix} = begin{bmatrix} 1 & 0 & 0 & 0  0 & 1 & 0 & 0  0 & 0 & 1 & 0  0 & 0 & 1 & 0 end{bmatrix} begin{bmatrix} x  y  z  1 end{bmatrix}

(The result of carrying out this multiplication is that (xc,yc,zc,wc) = (x,y,z,z).)


After carrying out the matrix multiplication, the homogeneous component wc will, in general, not be equal to 1. Therefore, to map back into the real plane we must perform the homogeneous divide, i.e. divide each component by wc:

 begin{bmatrix} x'  y'  z' end{bmatrix} = begin{bmatrix} x_c / w_c  y_c / w_c  z_c / w_c end{bmatrix}

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

A 3D projection is a mathematical transformation used to project three dimensional points onto a two dimensional plane[1]. Often this is done to simulate the relationship of a camera to a subject, as 3D projection is often the first step in the process of representing three dimensional shapes two...

External links

  • The Matrix Page - practical examples in POV-Ray

  Results from FactBites:
 
senocular.com Tutorial: Understanding the Transformation Matrix in Flash 8 page 1 (6279 words)
In the Matrix class in Flash, u,v, and w are not accessible as properties as a, b, c, d, tx, and ty are.
With matrix multiplication, however, it is required that the first matrix in the operation have a number of columns equal to the number of rows in the second matrix.
In matrix multiplication, the resulting matrix is an m x n matrix where m is the number of rows in the first matrix and n is the number of columns in the second.
Transformation matrix - Wikipedia, the free encyclopedia (1041 words)
If one has a linear transformation T(x) in functional form, it is easy to determine the transformation matrix A by simply transforming each of the vectors of the standard basis by T and then inserting the results into the columns of a matrix.
A consequence of the ability to compose transformations by multiplying their matrices is that transformations can also be inverted by simply inverting their matrices.
All ordinary linear transformations can be converted into affine transformations by expanding their matrices by one row and column, filling the extra space with zeros except for the lower-right corner, which must be set to 1.
  More results at FactBites »


 

COMMENTARY     


Share your thoughts, questions and commentary here
Your name
Your comments
Please enter the 5-letter protection code

Want to know more?
Search encyclopedia, statistics and forums:

 


Lesson Plans | Student Area | Student FAQ | Reviews | Press Releases |  Feeds | Contact
The Wikipedia article included on this page is licensed under the GFDL.
Images may be subject to relevant owners' copyright.
All other elements are (c) copyright NationMaster.com 2003-5. All Rights Reserved.
Usage implies agreement with terms.