Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
Transformation matrix
(section)
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
==Examples in 2 dimensions== Most common [[geometric transformation]]s 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=== 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 {{math|1=<var>x'</var> = <var>kx</var>}}; {{math|1=<var>y'</var> = <var>y</var>}} for some positive constant {{mvar|k}}. (Note that if {{math|1=<var>k</var> > 1}}, then this really is a "stretch"; if {{math|1=<var>k</var> < 1}}, it is technically a "compression", but we still call it a stretch. Also, if {{math|1=<var>k</var> = 1}}, then the transformation is an identity, i.e. it has no effect.) The matrix associated with a stretch by a factor {{mvar|k}} along the x-axis is given by: <math display="block">\begin{bmatrix} k & 0 \\ 0 & 1 \end{bmatrix} </math> Similarly, a stretch by a factor <var>k</var> along the y-axis has the form {{math|1=<var>x'</var> = <var>x</var>}}; {{math|1=<var>y'</var> = <var>ky</var>}}, so the matrix associated with this transformation is <math display="block">\begin{bmatrix} 1 & 0 \\ 0 & k \end{bmatrix} </math> ===Squeezing=== If the two stretches above are combined with reciprocal values, then the transformation matrix represents a [[squeeze mapping]]: <math display="block">\begin{bmatrix} k & 0 \\ 0 & 1/k \end{bmatrix} .</math> 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=== For [[coordinate rotation|rotation]] by an angle ΞΈ '''counterclockwise''' (positive direction) about the origin the functional form is <math>x' = x \cos \theta - y \sin \theta</math> and <math>y' = x \sin \theta + y \cos \theta</math>. Written in matrix form, this becomes:<ref>{{Cite web | url=http://ocw.mit.edu/courses/aeronautics-and-astronautics/16-07-dynamics-fall-2009/lecture-notes/MIT16_07F09_Lec03.pdf | title=Lecture Notes | website=ocw.mit.edu | access-date=2024-07-28}}</ref> <math display="block">\begin{bmatrix} x' \\ y' \end{bmatrix} = \begin{bmatrix} \cos \theta & -\sin\theta \\ \sin \theta & \cos \theta \end{bmatrix} \begin{bmatrix} x \\ y \end{bmatrix}</math> Similarly, for a rotation '''clockwise''' (negative direction) about the origin, the functional form is <math>x' = x \cos \theta + y \sin \theta</math> and <math>y' = -x \sin \theta + y \cos \theta</math> the matrix form is: <math display="block">\begin{bmatrix} x' \\ y' \end{bmatrix} = \begin{bmatrix} \cos \theta & \sin\theta \\ -\sin \theta & \cos \theta \end{bmatrix} \begin{bmatrix} x \\ y \end{bmatrix}</math> These formulae assume that the ''x'' axis points right and the ''y'' axis points up. ===Shearing=== For [[shear mapping]] (visually similar to slanting), there are two possibilities. A shear parallel to the ''x'' axis has <math>x' = x + ky</math> and <math>y' = y</math>. Written in matrix form, this becomes: <math display="block">\begin{bmatrix} x' \\ y' \end{bmatrix} = \begin{bmatrix} 1 & k \\ 0 & 1 \end{bmatrix} \begin{bmatrix} x \\ y \end{bmatrix}</math> A shear parallel to the ''y'' axis has <math>x' = x</math> and <math>y' = y + kx</math>, which has matrix form: <math display="block"> \begin{bmatrix} x' \\ y' \end{bmatrix} = \begin{bmatrix} 1 & 0 \\ k & 1 \end{bmatrix} \begin{bmatrix} x \\ y \end{bmatrix} </math> ===Reflection=== {{main|Householder transformation}} For reflection about a line that goes through the origin, let <math>\mathbf{l} = (l_x, l_y)</math> be a [[vector (geometric)|vector]] in the direction of the line. Then the transformation matrix is: <math display="block">\mathbf{A} = \frac{1}{\lVert\mathbf{l}\rVert^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}</math> ===Orthogonal projection=== {{further|Orthogonal projection}} To project a vector orthogonally onto a line that goes through the origin, let <math>\mathbf{u} = (u_x, u_y)</math> be a [[vector (geometric)|vector]] in the direction of the line. Then the transformation matrix is: <math display="block">\mathbf{A} = \frac{1}{\lVert\mathbf{u}\rVert^2} \begin{bmatrix} u_x^2 & u_x u_y \\ u_x u_y & u_y^2 \end{bmatrix}</math> As with reflections, the orthogonal projection onto a line that does not pass through the origin is an affine, not linear, transformation. [[Projection (linear algebra)|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#Use in computer graphics and computer vision|homogeneous coordinates]] can be used.
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)