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
Rotation 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!
==In two dimensions== [[File:Counterclockwise rotation.png|thumb|A counterclockwise rotation of a vector through angle {{mvar|θ}}. The vector is initially aligned with the {{mvar|x}}-axis.]] In two dimensions, the standard rotation matrix has the following form: :<math>R(\theta) = \begin{bmatrix} \cos\theta & -\sin\theta \\ \sin\theta & \cos\theta \\ \end{bmatrix}.</math><!-- These signs are correct. Please do not change them. Do not confound with the matrix that rotate a coordinate system. DO check calculations with a test vector, i.e. (1, 0) or (0, 1) over 45 degrees and try to understand the results, why is the rotation *clockwise*? Review the results. Then ask yourself 'what is rotated from which coordinate system?' It would be helpfull if such an detailed example is included in the text itself --> This rotates [[column vector]]s by means of the following [[matrix multiplication]], :<math> \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> Thus, the new coordinates {{math|(''x''′, ''y''′)}} of a point {{math|(''x'', ''y'')}} after rotation are :<math>\begin{align} x' &= x \cos\theta - y \sin\theta\, \\ y' &= x \sin\theta + y \cos\theta\, \end{align}.</math> === Examples === For example, when the vector (initially aligned with the ''x''-axis of the [[Cartesian coordinate system]]) :<math> \mathbf{\hat{x}} = \begin{bmatrix} 1 \\ 0 \\ \end{bmatrix} </math> is rotated by an angle {{mvar|θ}}, its new coordinates are :<math> \begin{bmatrix} \cos\theta \\ \sin\theta \\ \end{bmatrix}, </math> and when the vector (initially aligned with the ''y''-axis of the coordinate system) :<math> \mathbf{\hat{y}} = \begin{bmatrix} 0 \\ 1 \\ \end{bmatrix} </math> is rotated by an angle {{mvar|θ}}, its new coordinates are :<math> \begin{bmatrix} -\sin\theta \\ \cos\theta \\ \end{bmatrix}. </math> === Direction === The direction of vector rotation is counterclockwise if {{mvar|θ}} is positive (e.g. 90°), and clockwise if {{mvar|θ}} is negative (e.g. −90°) for <math> R(\theta)</math>. Thus the clockwise rotation matrix is found as (by replacing {{mvar|θ}} with {{mvar|-θ}} and using the trigonometric symmetry of <math display="inline">\sin(-\theta) = - \sin(\theta)</math> and <math display="inline">\cos( - \theta) = \cos(\theta)</math>) :<math> R(-\theta) = \begin{bmatrix} \cos\theta & \sin\theta \\ -\sin\theta & \cos\theta \\ \end{bmatrix}.</math> An alternative convention uses rotating axes (instead of rotating a vector),<ref>{{cite book |last=Swokowski |first=Earl |url=https://archive.org/details/studentsupplemen00bron |title=Calculus with Analytic Geometry |publisher=Prindle, Weber, and Schmidt |year=1979 |isbn=0-87150-268-2 |edition=Second |location=Boston |url-access=registration}}</ref> and the above matrices also represent a rotation of the ''axes clockwise'' through an angle {{mvar|θ}}. The two-dimensional case is the only non-trivial case where the rotation matrices group is commutative; it does not matter in which order rotations are multiply performed. For the 3-dimensional case, for example, a different order of multiple rotations gives a different result. (E.g., rotating a cell phone along ''z''-axis then ''y''-axis is not equal to rotations along the ''y''-axis then ''z''-axis.) ===Non-standard orientation of the coordinate system=== [[File:Clockwise rotation.png|thumb|A rotation through angle {{mvar|θ}} with non-standard axes.]] If a standard [[Orientation (mathematics)|right-handed]] [[Cartesian coordinate system]] is used, with the {{nowrap|{{mvar|x}}-axis}} to the right and the {{nowrap|{{mvar|y}}-axis}} up, the rotation {{math|''R''(''θ'')}} is counterclockwise. If a left-handed Cartesian coordinate system is used, with {{mvar|x}} directed to the right but {{mvar|y}} directed down, {{math|''R''(''θ'')}} is clockwise. Such non-standard orientations are rarely used in mathematics but are common in [[2D computer graphics]], which often have the origin in the top left corner and the {{nowrap|{{mvar|y}}-axis}} down the screen or page.<ref>{{Cite web |url=http://www.w3.org/TR/SVG/coords.html#InitialCoordinateSystem |title=Scalable Vector Graphics – the initial coordinate system |author=W3C recommendation |year=2003 }}</ref> See [[#Ambiguities|below]] for other alternative conventions which may change the sense of the rotation produced by a rotation matrix. ===Common 2D rotations=== Matrices :<math>\begin{bmatrix} 0 & -1 \\[3pt] 1 & 0 \\ \end{bmatrix}, \quad \begin{bmatrix} -1 & 0 \\[3pt] 0 & -1 \\ \end{bmatrix}, \quad \begin{bmatrix} 0 & 1 \\[3pt] -1 & 0 \\ \end{bmatrix}</math> are 2D rotation matrices corresponding to counter-clockwise rotations of respective angles of 90°, 180°, and 270°. ===Relationship with complex plane=== The matrices of the shape <math display=block>\begin{bmatrix} x & -y \\ y & x \end{bmatrix}</math> form a [[ring (mathematics)|ring]], since their set is closed under addition and multiplication. Since <math display=block>\begin{bmatrix} 0 & -1 \\ 1 & 0 \end{bmatrix}^2 \ =\ \begin{bmatrix} -1 & 0 \\ 0 & -1 \end{bmatrix} \ = -I</math> (where <math display="inline">I</math> is the [[identity matrix]]), the map :<math>\begin{bmatrix} x & -y \\ y & x \end{bmatrix} = x\begin{bmatrix} 1 & 0 \\ 0 & 1 \end{bmatrix} + y \begin{bmatrix} 0 & -1 \\ 1 & 0 \end{bmatrix} \mapsto x+iy</math> (where <math>i = \begin{bmatrix} 0 & -1 \\ 1 & 0 \end{bmatrix}</math>) is a [[ring isomorphism]] from this ring to the [[field (mathematics)|field]] of the [[complex number]]s {{tmath|\C}} (incidentally, this shows that this ring is a field). Under this isomorphism, the rotation matrices correspond to the [[circle]] of the [[unit complex number]]s, the complex numbers of modulus {{math|1}}. If one identifies <math>\mathbb R^2</math> with <math>\mathbb C</math> through the [[linear isomorphism]] <math>(a,b)\mapsto a+ib</math>, where <math>(a,b) \in \mathbb R^2</math> and <math>a+ib \in \mathbb C</math>, the action of a matrix <math>\begin{bmatrix} x & -y \\ y & x \end{bmatrix}</math> on a vector <math>(a,b)</math> corresponds to multiplication on the complex number <math>a+ib</math> by {{math|''x'' + ''iy''}}, and a rotation correspond to multiplication by a complex number of modulus {{math|1}}. As every 2-dimensional rotation matrix can be written :<math>\begin{pmatrix}\cos t&-\sin t\\ \sin t&\cos t\end{pmatrix},</math> the above correspondence associates such a matrix with the complex number :<math>e^{it} = \cos t + i\sin t = \cos t \begin{bmatrix} 1 & 0 \\ 0 & 1 \end{bmatrix} + \sin t \begin{bmatrix} 0 & -1 \\ 1 & 0 \end{bmatrix}</math> where the first equality is [[Euler's formula]], the matrix <math>I = \begin{bmatrix} 1 & 0 \\ 0 & 1 \end{bmatrix}</math>corresponds to 1, and the matrix <math>\begin{bmatrix} 0 & -1 \\ 1 & 0 \end{bmatrix}</math> corresponds to the [[imaginary unit]] <math display="inline">i</math>.
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)