Rotation as a Trigonometric Operation

Part 12, Chapter 12: Trigonometry of the Unit Circle

Learning objectives

  • Write the rotation matrix for angle theta
  • Apply the rotation matrix to rotate a point
  • Compose two rotations and simplify
  • Understand rotations as linear transformations

So far the unit circle has been a static picture. Now we make it move. A rotation spins the whole plane around the origin by some angle theta\theta, taking each point to a new point. The question this section answers: if I know (x,y)(x, y) and I rotate by theta\theta, what are the new coordinates? The answer is a single, beautiful formula, the rotation matrix, whose entries are sine and cosine of theta\theta. It is also the first time matrices show up in this textbook, and rotations are the cleanest possible introduction to what a matrix really is: a recipe for transforming a vector.

Deriving the formula

Write the point (x,y)(x, y) in polar form (rcosalpha,,rsinalpha)(r\cos\alpha,\, r\sin\alpha) for some radius rr and angle alpha\alpha. A counterclockwise rotation by theta\theta keeps the radius and adds theta\theta to the angle:

(rcos(alpha+theta),;rsin(alpha+theta))(r\cos(\alpha + \theta),\; r\sin(\alpha + \theta))

Apply the addition formulas:

rcos(alpha+theta)=r(cosalphacosthetasinalphasintheta)=xcosthetaysinthetar\cos(\alpha + \theta) = r(\cos\alpha\cos\theta - \sin\alpha\sin\theta) = x\cos\theta - y\sin\theta

rsin(alpha+theta)=r(sinalphacostheta+cosalphasintheta)=ycostheta+xsinthetar\sin(\alpha + \theta) = r(\sin\alpha\cos\theta + \cos\alpha\sin\theta) = y\cos\theta + x\sin\theta

So the new coordinates (x,y)(x', y') are

x=xcosthetaysintheta,qquady=xsintheta+ycosthetax' = x\cos\theta - y\sin\theta, \qquad y' = x\sin\theta + y\cos\theta

The rotation matrix

Stack the two scalar equations into one matrix equation:

\begin{pmatrix} x' \\ y' \end{pmatrix} = \begin{pmatrix} \cos\theta & -\sin\theta \\ \sin\theta & \phantom{-}\cos\theta \end{pmatrix} \begin{pmatrix} x \\ y \end{pmatrix}

The 2times22\times 2 matrix is the rotation matrix, usually written R(theta)R(\theta). Multiplying it against the column vector (x,y)T(x, y)^T gives the rotated point.

Where this shows up
  • Computer Graphics: Every 2D rotation in a game engine, character turning, sprite spinning, UI flourish, is (x,y)mapsto(xcosthetaysintheta,;xsintheta+ycostheta)(x, y) \mapsto (x\cos\theta - y\sin\theta,\; x\sin\theta + y\cos\theta); this single matrix is hand-coded into thousands of game loops.
  • Robotics: Rotation matrices about each joint axis are composed to compute the end-effector position; this is forward kinematics, and every industrial robot's controller runs this composition tens of times per second.
  • Cryptography: Some lattice-based cryptosystems rely on rotations in high-dimensional integer lattices; the difficulty of recovering small basis vectors after rotation is what makes them post-quantum secure.

(Snap to a standard angle and read off costheta\cos\theta and sintheta\sin\theta. Those two values are the entries of the rotation matrix: column one is (costheta,sintheta)T(\cos\theta, \sin\theta)^T, column two is (sintheta,costheta)T(-\sin\theta, \cos\theta)^T. The columns are exactly the images of the basis vectors hate_1=(1,0)\hat e_1 = (1, 0) and hate2=(0,1)\hat e_2 = (0, 1) under the rotation.)

Composition: rotating twice

If you rotate by alpha\alpha and then by beta\beta, the net effect is a rotation by alpha+beta\alpha + \beta. In matrix form:

R(beta)cdotR(alpha)=R(alpha+beta)R(\beta) \cdot R(\alpha) = R(\alpha + \beta)

The proof is a direct computation using the addition formulas. So the family of rotation matrices is closed under multiplication, with the angle adding modulo 2pi2\pi. This is the cleanest possible example of an abelian group, and it foreshadows the role of complex multiplication in section 15.2.

Four properties to remember

  • Distances are preserved, rotations are rigid motions. R(theta)mathbfv=mathbfv|R(\theta) \mathbf{v}| = |\mathbf{v}|.
  • Angles between any two vectors are preserved.
  • The inverse of R(theta)R(\theta) is R(theta)R(-\theta). Rotating by theta-\theta undoes the rotation by theta\theta.
  • The determinant is detR(theta)=cos2theta+sin2theta=1\det R(\theta) = \cos^2\theta + \sin^2\theta = 1. Areas are preserved with orientation.

Worked example

Rotate (3,0)(3, 0) by pi/6\pi/6. From the standard table cos(pi/6)=sqrt3/2\cos(\pi/6) = \sqrt{3}/2, sin(pi/6)=1/2\sin(\pi/6) = 1/2:

x=3cdottfracsqrt320cdottfrac12=tfrac3sqrt32x' = 3 \cdot \tfrac{\sqrt{3}}{2} - 0 \cdot \tfrac{1}{2} = \tfrac{3\sqrt{3}}{2}

y=3cdottfrac12+0cdottfracsqrt32=tfrac32y' = 3 \cdot \tfrac{1}{2} + 0 \cdot \tfrac{\sqrt{3}}{2} = \tfrac{3}{2}

The image is (3sqrt3/2,;3/2)(3\sqrt{3}/2,\; 3/2). Sanity check: the distance from origin is sqrt27/4+9/4=sqrt9=3\sqrt{27/4 + 9/4} = \sqrt{9} = 3. Same as before, rotations preserve distance.

Try it

  • Rotate (1,1)(1, 1) by pi/2\pi/2. (Expect (1,1)(-1, 1).)
  • Compute R(pi/3)cdotR(pi/6)R(\pi/3) \cdot R(\pi/6). Use the composition rule, not the matrix product, then verify by direct multiplication.
  • A point at (2,5)(2, 5) is the result of rotating some original point PP by pi/2\pi/2. Find PP. (Apply the inverse rotation R(pi/2)R(-\pi/2).)

Pause: if a matrix preserves distances and has determinant 11, it must be a rotation. Can you sketch why? (Hint: a rigid map that fixes the origin sends basis vectors to two perpendicular unit vectors; the determinant being +1+1 rules out reflection.)

A trap to watch for

The sign convention. Counterclockwise rotations correspond to positive theta\theta; clockwise to negative. Computer graphics often uses the opposite convention (because the screen y-axis points down), so a "rotate by 90°" in a CSS transform might look like a rotation in the wrong direction relative to mathematical convention. Always re-check the orientation of the y-axis before plugging into the rotation matrix. In this textbook the y-axis always points up and CCW is positive.

A second trap: the formula R(beta)cdotR(alpha)=R(alpha+beta)R(\beta) \cdot R(\alpha) = R(\alpha + \beta) holds because rotations commute. This is a luxury, matrix multiplication is not generally commutative. For arbitrary 2times22 \times 2 matrices ABneqBAAB \neq BA in general. Rotations are special because they form an abelian subgroup of the general linear group.

What you now know

You can write the rotation matrix R(theta)R(\theta), apply it to a point to compute the rotated coordinates, compose two rotations by adding angles, recognise that rotations preserve distance and area, and check the sign convention before plugging in. The next chapter switches gears: we leave trigonometry behind and begin analytic geometry, where coordinate methods are turned loose on lines, parabolas, ellipses, and hyperbolas.

Quick check

Mark section complete →

References

  • Lang, S. (1971). Basic Mathematics. Springer. Chapter 11, §6, rotations derived from the addition formulas, leading into matrix notation.
  • Apostol, T. M. (1969). Calculus, Volume 2: Multi-Variable Calculus and Linear Algebra (2nd ed.). Wiley. Chapter 5: rotations as orthogonal transformations.
  • Strang, G. (2016). Introduction to Linear Algebra (5th ed.). Wellesley-Cambridge Press. Chapter 7: rotation matrices as the simplest orthogonal matrices.

This page is prerendered for SEO and accessibility. The interactive widgets above hydrate on JavaScript load.