MathorynMathematical Formula Database

Linear Algebra

2D Rotation Matrix

Multiplying a column vector by R(θ)R(\theta) rotates it counter-clockwise by angle θ\theta about the origin. It is used in computer graphics, robotics and coordinate changes; its determinant is 11 and its inverse is its transpose.

R(θ)=(cos⁡θ−sin⁡θsin⁡θcos⁡θ)R(\theta)=\begin{pmatrix}\cos\theta&-\sin\theta\\\sin\theta&\cos\theta\end{pmatrix}
LaTeXR(\theta)=\begin{pmatrix}\cos\theta&-\sin\theta\\\sin\theta&\cos\theta\end{pmatrix}

Variables

θ\theta
rotation angle (counter-clockwise)
R(θ)R(\theta)
rotation matrix

Example

Rotate (2,1)(2,1) by 30∘30^\circ.

  1. cos⁡30∘≈0.8660\cos30^\circ\approx0.8660, sin⁡30∘=0.5\sin30^\circ=0.5.
  2. x′=2⋅0.8660−1⋅0.5x'=2\cdot0.8660-1\cdot0.5, y′=2⋅0.5+1⋅0.8660y'=2\cdot0.5+1\cdot0.8660.

Answer: (x′,y′)≈(1.2321, 1.8660)(x',y')\approx(1.2321,\ 1.8660).

Related formulas