Rotation of a vector in two dimensions
The rotation matrix
Rotate a vector through an angle to give . The angle is positive anticlockwise.
- The length is unchanged and the polar angle goes from to :
- Expanding the compound angles gives and . This is linear in , so it can be written as a matrix acting on .
rotates any 2D vector through anticlockwise.
Show derivation
Write , so and . Rotation keeps and adds to the angle: . By the compound-angle formulas (databook maths p4):
In “rotate p”, move and check that never changes. In “basis vectors”, the two columns of in the readout are the tips of and (drawn 1.4 times longer than the unit vectors so they stay visible). Values of above are clockwise rotations through .
Columns are the images of the basis vectors
There is a general method that avoids the trigonometry: a transformation matrix’s columns are the images of the basis vectors.
For a linear transformation , column of is the image of the -th basis vector. To write down the matrix, find where each basis vector goes and put those images in as columns.
Show derivation
(i) Column is the image of . By the Matrix product (element form), , because (Kronecker delta). So is the -th column.
(ii) The images fix the whole map. A rotation is linear: turning the parallelogram that builds rigidly gives a parallelogram that builds the rotated sum, and stretching then rotating is the same as rotating then stretching. Write . Then
For a rotation through , read the images off the figure:
Putting these in as columns gives the same as in 2D rotation matrix.
Explanation Where does the minus sign go?
Picture a small positive . tips up, towards , so column 1 is . tips left, towards , so column 2 is . The minus sign therefore sits top-right. If you misremember it, you get the clockwise rotation, which is .
Inverse, orthogonality and determinant
rotates through anticlockwise, so must rotate through clockwise. That is the same matrix with replaced by .
Show derivation
Undoing an anticlockwise rotation through is a rotation through . So replace by in 2D rotation matrix and use and . Check:
Comparing the forms gives , and so .
A square matrix is orthogonal if
Show derivation
Using (databook maths p15):
An orthogonal matrix with is a proper orthogonal matrix, also called a rotation matrix.
- Build any transformation matrix from columns: column is the image of .
- 2D rotation: is positive anticlockwise, and the minus sign is top-right.
- Inverse = rotate back = transpose. Never use cofactors to invert a rotation matrix.
- Rotation matrix ⇔ orthogonal () and .
Rotation of a vector in three dimensions
Let be an arbitrary rotation about some axis. Use the general method (Columns of a transformation matrix): find where each basis vector goes. maps to , to and to .
is the vector that the basis vector is rotated to.
Show derivation
A rotation in 3D is linear, for the same reason as in 2D. Write . Then , which is the matrix with columns times . By Columns of a transformation matrix, is column , i.e. .
Drag to rotate the view. The columns of in the readout are the tips of . Whatever the axis and angle, the three stay unit length and mutually perpendicular. The default (axis at in the – plane, ) is the matrix of the revision example.
Explanation Is the vector moving or the axes?
Throughout this lecture the vector moves and the coordinate axes stay fixed: gives the new vector’s components in the same frame. Next lecture the axes move instead (change of basis). Keep the two pictures separate when reading a question.
- A 3D rotation matrix is fully set by three columns: = where ends up. You do not need the axis explicitly.
Rotation about the y-axis
Example: find the matrix for a rotation through about the -axis.
- By the right-hand rule (The right-hand screw rule), positive rotation about is in the sense towards .
- The position does not change, so only the movement in the – plane matters.
With into the page, a positive rotation about is clockwise on the page. turns towards and turns towards .
The images of the basis vectors are:
| basis vector | maps to |
|---|---|
is positive by the right-hand rule about , i.e. towards .
Show derivation
Use 3D rotation matrix from the basis images: find each .
- lies on the axis, so it does not move: .
- In the – plane (figure), turns through towards : .
- turns through in the same sense, away from towards : .
Put in as columns.
About the -axis the is bottom-left, not top-right, because positive means (not ). Always derive the signs from the images of the basis vectors rather than copying a pattern.
Explanation Why is ‘z towards x’ the positive sense about y?
Point your right thumb along : your fingers curl from to . The rule is the cyclic order (Products of the basis vectors (cyclic order)):
- about : towards ;
- about : towards ;
- about : towards .
For the “first” axis in the pair is . That is why the – block looks like the 2D matrix with the sign of reversed.
- Positive rotation about an axis follows the right-hand rule, with the cyclic order . About this means towards .
- The basis vector along the axis is unchanged: its row and column are those of .
Orthogonality and the inverse of a rotation matrix
Orthonormal columns
By the very nature of rotations (lengths and angles do not change), the vectors are themselves unit vectors and mutually perpendicular.
A set of vectors is orthonormal if each is a unit vector and each pair is perpendicular:
The inverse is the transpose in three dimensions too
In 2D we found . In 3D, the rows of are the , so by row-times-column multiplication, using (Orthonormal set):
So every rotation matrix is orthogonal (Orthogonal matrix). is the rotation through the same angle about the same axis, in the opposite sense.
Show derivation
Entry of is (row of )·(column of ) (Orthonormal set). So .
Taking determinants (databook maths p17) gives , so and exists. Multiply on the right by to get . Hence as well.
undoes , and the motion that undoes a rotation is the same rotation run backwards.
The rows of also form an orthonormal set.
Show derivation
is itself a rotation, so its columns are orthonormal (the argument of Orthonormal set). The columns of are the rows of . Algebraically, entry of is (row of )·(row of ) .
Explanation What does this buy you in practice?
- Inverting a rotation matrix is free: transpose it.
- Testing whether a matrix is orthogonal means checking . That is the same as checking that the columns are unit and mutually perpendicular: six dot products in 3D.
- If the columns pass, the rows pass automatically. You never need to check both.
- Columns of a rotation matrix are orthonormal: . So are its rows.
- is the table of dot products , which is why orthonormal columns give .
- is the same rotation in reverse (same axis, same angle, opposite sense).
Non-commutativity
In 2D, rotating first by then by gives the same result as first by then by . In 3D the order matters, unless the rotations share an axis.
2D rotations commute. In 3D, rotations about the same axis commute.
Show derivation
2D. Multiply two matrices of the form 2D rotation matrix and use the compound-angle formulas (databook maths p4):
3D counterexample. Track through about and about (positive senses and ):
- first, then : is on the -axis so it stays at . Then about it goes to .
- first, then : . Then about , .
The final images differ ( vs ), so the two products differ.
To convince yourself, take a book and rotate it about the -axis, then about the -axis. Then try the reverse order.
Press ▶ (: first rotation, : second), then switch the order and play again. The book ends in different orientations: finishes at for “x then y” but at for “y then x”.
Order of matrices. “First , then ” applied to is . The first rotation sits next to the vector, i.e. on the right.
- 2D rotations commute: . 3D rotations commute only if they share an axis.
- Read a product right-to-left: the rightmost matrix acts first.
Orthogonal transformations preserve lengths and angles
Rotations are represented by orthogonal matrices. Is the converse true: does an orthogonal matrix necessarily imply a rotation? To answer this, look at general properties of orthogonal transformations.
If and , then for every .
Show derivation
Length squared is (Scalar product in components, Column vector and transpose). Using (databook maths p17):
Together with preserved lengths, this means the angle between any two vectors is unchanged (Angle between two vectors).
Show derivation
Reflections also have both properties. So length and angle preservation cannot tell a reflection matrix from a rotation matrix. Another test is needed.
- Any orthogonal preserves lengths and scalar products, hence angles. The proof is one line: .
- Reflections preserve these too, so “orthogonal” alone does not mean “rotation”.
Reflection vs rotation
Reflection in a plane
Reflect a vector in the – plane to give . The in-plane components stay and the component normal to the plane reverses.
As a matrix: , which is orthogonal with .
Show derivation
Definition of a reflection in a plane: components parallel to the plane are unchanged, and the component along the normal is reversed. The normal to the – plane is , so only changes sign.
For the matrix, use Columns of a transformation matrix: , , . The columns are orthonormal, and .
Only the -component flips: and have the same shadow (grey) in the plane and the same length.
For a reflection in an arbitrary plane, rotate the frame so that two of its vectors lie in the plane of reflection, then apply the same argument.
Note (not strictly in the syllabus): two reflections produce a rotation.
Explanation Why do two reflections make a rotation?
Each reflection matrix is orthogonal with . The product of two is orthogonal (it preserves lengths and angles, because each factor does) and has (databook maths p17). By det Q distinguishes rotation from reflection below, that is a rotation. In 2D you can see it directly: reflecting in two mirror lines at angle to each other rotates through .
Telling them apart: handedness and det Q
- a pure rotation: form a right-handed set, .
- = rotations plus an odd number of reflections: a left-handed set, .
Show derivation
The basis is right-handed: (A right-handed coordinate frame, Products of the basis vectors (cyclic order)).
Rotation. Turn the frame gradually from angle 0 to . At every stage the are orthonormal, so is a unit vector perpendicular to both, i.e. . The sign cannot jump during a continuous motion, and it is at the start, so throughout.
Reflection in the – plane (Reflection in the x–y plane): , , . So : left-handed. A reflection in any other plane is this one seen in a rotated frame, so it also reverses handedness.
Each further reflection flips the handedness again and rotations never change it. So an odd number of reflections gives a left-handed set.
The two cases are distinguished by evaluating .
This is the signed volume of the unit cube with edges . For an orthogonal :
| meaning | |
|---|---|
| rotation | |
| reflection (+ rotation) |
Show derivation
, a standard property of determinants (expanding along a column gives the same as along a row). The rows of are . Expanding along the first row (databook maths p15) and comparing with Vector product in components:
For an orthonormal set, Rotations keep handedness, reflections reverse it gives:
- right-handed: (cyclic, as for ), so ;
- left-handed: , so .
Independent check that no other value is possible: gives (databook maths p17).
is the -rotation of Rotation through α about the y-axis, optionally followed by the reflection of Reflection in the x–y plane. No value of changes the sign of the determinant; only the reflection toggle does. Rotate the view: with the reflection on, no amount of turning makes the left-handed set match .
Explanation Does det Q = −1 mean ‘just a reflection’?
Not necessarily. It means rotation plus an odd number of reflections. For example (every vector reversed) has in 3D. It is not a mirror image in any single plane, but it equals a reflection in the – plane combined with a rotation about .
- Reflection in a plane: in-plane components kept, normal component reversed. In the – plane, .
- Orthogonal with : rotation, with .
- Orthogonal with : reflection (+ rotation), with .
- is the signed volume of the unit cube. For orthogonal it is always exactly .
Revision example: general rotation matrix
A matrix represents a rotation if and only if:
- its columns are unit vectors;
- its columns are mutually perpendicular (1 and 2 together: );
- , or equivalently .
Show derivation
Necessary. A rotation satisfies (Inverse of a rotation matrix), whose entries say : conditions 1 and 2. It also has (det Q distinguishes rotation from reflection). For an orthonormal set, and , so is the same as .
Sufficient (not required). Suppose and . Then
preserves scalar products (Orthogonal matrices preserve scalar products and angles), so it maps the plane perpendicular to to itself. In an orthonormal basis made of and two vectors in that plane, the matrix is block-diagonal: a for and a orthogonal block with determinant .
The block’s first column is a unit vector . Its second column is a unit vector perpendicular to that, so it is . A determinant of picks the sign, which gives 2D rotation matrix. So is a rotation through about .
Example Show that this matrix represents a rotation
Useful: .
1. Orthogonal columns.
2. Unit columns.
3. Determinant (expand along the first row):
Since (a) the determinant is and (b) the columns are unit length and mutually orthogonal, the matrix represents a rotation.
Explanation Which rotation is it?
Any vector on the axis is unchanged by the rotation. Try :
- To show “rotation”: check the columns are unit, check they are pairwise perpendicular, then check (or ).
- Keep surds tidy by squaring once: here .