Rotation+matrix

Reference: []

In [|linear algebra], a **rotation matrix** is a [|matrix] that is used to perform a [|rotation] in [|Euclidean space]. For example the matrix [[image:http://upload.wikimedia.org/math/d/f/a/dfa9eccf5f8f2de1ac8ee1134ba88a86.png caption="R = \begin{bmatrix} \cos \theta & -\sin \theta \\ \sin \theta & \cos \theta \\ \end{bmatrix} "]] rotates points in the //xy//- [|Cartesian plane] counterclockwise through an angle //θ// about the origin of the [|Cartesian coordinate system]. To perform the rotation using a rotation matrix //R//, the position of each point must be represented by a [|column vector] **v**, containing the coordinates of the point. A rotated vector is obtained by using the [|matrix multiplication] //R//**v**. Since matrix multiplication always fixes the zero vector, rotation matrices can only be used to describe rotations that fix the origin. Rotation matrices provide a simple algebraic description of such rotations, and are used extensively for computations in [|geometry], [|physics] , and [|computer graphics]. These rotations can be in dimension 2, where they are determined by the angle//θ// of rotation, or in dimension 3, where in addition an axis of rotation is involved; the angle and axis are implicitly represented by the entries of the rotation matrix. The notion of rotation is not commonly used in dimensions higher than 3; there is a notion of a **rotational displacement**, which can be represented by a matrix, but no associated single axis or angle. Rotation matrices are [|square matrices], with [|real] entries. More specifically they can be characterized as [|orthogonal matrices] with [|determinant] 1: .

Rotations in two dimensions
A counterclockwise rotation of a vector through angle //θ//. The vector is initially aligned with the x-axis. In two dimensions every rotation matrix has the following form: [[image:http://upload.wikimedia.org/math/3/8/f/38f4b1b17056c57ea7cb7f2188c9a81a.png caption=" R(\theta) = \begin{bmatrix} \cos \theta & -\sin \theta \\ \sin \theta & \cos \theta \\ \end{bmatrix}"]]. This rotates [|column vectors] by means of the following [|matrix multiplication] : [[image:http://upload.wikimedia.org/math/7/5/2/752fd6396a9c9d026f10eccb39ddca15.png caption=" \begin{bmatrix} x' \\ y' \\ \end{bmatrix} = \begin{bmatrix} \cos \theta & -\sin \theta \\ \sin \theta & \cos \theta \\ \end{bmatrix}\begin{bmatrix} x \\ y \\ \end{bmatrix}"]]. So the coordinates (x',y') of the point (x,y) after rotation are: ,. The direction of vector rotation is counterclockwise if θ is positive (e.g. 90°), and clockwise if θ is negative (e.g. -90°). [[image:http://upload.wikimedia.org/math/f/3/3/f338c036c7b38d2541d15ca1601e8803.png caption=" R(-\theta) = \begin{bmatrix} \cos \theta & \sin \theta \\ -\sin \theta & \cos \theta \\ \end{bmatrix}\,"]].

Common rotations
Particularly useful are the matrices for 90° and 180° rotations: [[image:http://upload.wikimedia.org/math/d/b/c/dbcfcdc115372dfe6e66982a841f9076.png caption=" R(90^\circ) = \begin{bmatrix} 0 & -1 \\[3pt] 1 & 0 \\ \end{bmatrix}"]] (90° counterclockwise rotation)[[image:http://upload.wikimedia.org/math/b/0/d/b0d7db5b1cf2e531126f13e1de38113b.png caption="R(180^\circ) = \begin{bmatrix} -1 & 0 \\[3pt] 0 & -1 \\ \end{bmatrix}"]] (180° rotation in either direction – a half-turn)[[image:http://upload.wikimedia.org/math/e/1/7/e17c4efcf457f9c618c5642111d8bb46.png caption="R(270^\circ) = \begin{bmatrix} 0 & 1 \\[3pt] -1 & 0 \\ \end{bmatrix}"]] (270° counterclockwise rotation, the same as a 90° clockwise rotation)