4.6: Rotation Matrices in 3-Dimensions
The Three Basic Rotations
A basic rotation of a vector in 3-dimensions is a rotation around one of the coordinate axes. We can rotate a vector counterclockwise through an angle \(\theta\) around the \(x\)–axis, the \(y\)–axis, or the \(z\)–axis.
To get a counterclockwise view, imagine looking at an axis straight on toward the origin.
Our plan is to rotate the vector
\(\left[ \begin{array}{c} x \\ y \\ z \end{array} \right]\)
counterclockwise around one of the axes through some angle
\(\theta\)
to the new position given by the vector \(\left[\begin{array}{l}
x^{\prime} \\
y^{\prime} \\
z^{\prime}
\end{array}\right]\). To do so, we will use one of the three rotation matrices.
The Rotation Matrices
The rotation matrices for \(x\) , \(y\) , and \(z\) axes are, respectively,
\[\left[\begin{array}{ccc}
1 & 0 & 0 \\
0 & \cos \theta & -\sin \theta \\
0 & \sin \theta & \cos \theta
\end{array}\right] \quad\left[\begin{array}{ccc}
\cos \theta & 0 & \sin \theta \\
0 & 1 & 0 \\
-\sin \theta & 0 & \cos \theta
\end{array}\right] \quad\left[\begin{array}{ccc}
\cos \theta & -\sin \theta & 0 \\
\sin \theta & \cos \theta & 0 \\
0 & 0 & 1
\end{array}\right] \nonumber \]
The Rotation Process
\(x\)–axis
To rotate the vector
\(\left[ \begin{array}{c} x \\ y \\ z \end{array} \right]\)
counterclockwise through an angle
\(\theta\)
around the
\(x\)
–axis to a new position
\(\left[\begin{array}{l}
x^{\prime} \\
y^{\prime} \\
z^{\prime}
\end{array}\right]\),
perform the matrix multiplication,
\[\left[\begin{array}{l}
x^{\prime} \\
y^{\prime} \\
z^{\prime}
\end{array}\right]=\left[\begin{array}{ccc}
1 & 0 & 0 \\
0 & \cos \theta & -\sin \theta \\
0 & \sin \theta & \cos \theta
\end{array}\right] \cdot\left[\begin{array}{l}
x \\
y \\
z
\end{array}\right] \nonumber \]
\(y\)–axis
To rotate the vector
\(\left[ \begin{array}{c} x \\ y \\ z \end{array} \right]\)
counterclockwise through an angle
\(\theta\)
around the
\(y\)
–axis to a new position
\(\left[\begin{array}{l}
x^{\prime} \\
y^{\prime} \\
z^{\prime}
\end{array}\right]\),
perform the matrix multiplication,
\[\left[\begin{array}{l}
x^{\prime} \\
y^{\prime} \\
z^{\prime}
\end{array}\right]=\left[\begin{array}{ccc}
\cos \theta & 0 & \sin \theta \\
0 & 1 & 0 \\
-\sin \theta & 0 & \cos \theta
\end{array}\right] \cdot\left[\begin{array}{l}
x \\
y \\
z
\end{array}\right] \nonumber \]
\(z\)–axis
To rotate the vector
\(\left[ \begin{array}{c} x \\ y \\ z \end{array} \right]\)
counterclockwise through an angle
\(\theta\)
around the
\(z\)
–axis to a new position
\(\left[\begin{array}{l}
x^{\prime} \\
y^{\prime} \\
z^{\prime}
\end{array}\right]\),
perform the matrix multiplication,
\[\left[\begin{array}{l}
x^{\prime} \\
y^{\prime} \\
z^{\prime}
\end{array}\right]=\left[\begin{array}{ccc}
\cos \theta & -\sin \theta & 0 \\
\sin \theta & \cos \theta & 0 \\
0 & 0 & 1
\end{array}\right] \cdot\left[\begin{array}{l}
x \\
y \\
z
\end{array}\right] \nonumber \]
Find the vector \(\left[\begin{array}{l}
x^{\prime} \\
y^{\prime} \\
z^{\prime}
\end{array}\right]\)
that results when the vector
\(\left[ \begin{array}{c} x \\ y \\ z \end{array} \right]=\left[ \begin{array}{c} 1 \\ 2 \\ 3 \end{array} \right]\)
is rotated 90° counterclockwise around
\(x\)-
axis.
Solution
Using the rotation formula \(\left[\begin{array}{l}
x^{\prime} \\
y^{\prime} \\
z^{\prime}
\end{array}\right]=\left[\begin{array}{ccc}
1 & 0 & 0 \\
0 & \cos \theta & -\sin \theta \\
0 & \sin \theta & \cos \theta
\end{array}\right] \cdot\left[\begin{array}{l}
x \\
y \\
z
\end{array}\right]\) with
\(\left[\begin{array}{l}
x \\
y \\
z
\end{array}\right]=\left[\begin{array}{l}
1 \\
2 \\
3
\end{array}\right]\)
and
\(\theta =90\mathrm{{}^\circ },\)
we get
\[\begin{aligned}
& {\left[\begin{array}{l}
x^{\prime} \\
y^{\prime} \\
z^{\prime}
\end{array}\right]=\left[\begin{array}{ccc}
1 & 0 & 0 \\
0 & \cos \theta & -\sin \theta \\
0 & \sin \theta & \cos \theta
\end{array}\right] \cdot\left[\begin{array}{c}
x \\
y \\
z
\end{array}\right]=\left[\begin{array}{ccc}
1 & 0 & 0 \\
0 & \cos 90^{\circ} & -\sin 90^{\circ} \\
0 & \sin 90^{\circ} & \cos 90^{\circ}
\end{array}\right] \cdot\left[\begin{array}{l}
1 \\
2 \\
3
\end{array}\right]} \\
& {\left[\begin{array}{l}
x^{\prime} \\
y^{\prime} \\
z^{\prime}
\end{array}\right]=\left[\begin{array}{ccc}
1 & 0 & 0 \\
0 & 0 & -1 \\
0 & 1 & 0
\end{array}\right] \cdot\left[\begin{array}{l}
1 \\
2 \\
3
\end{array}\right]=\left[\begin{array}{c}
1 \cdot 1+0 \cdot 2+0 \cdot 3 \\
0 \cdot 1+0 \cdot 2+(-1) \cdot 3 \\
0 \cdot 1+1 \cdot 2+0 \cdot 3
\end{array}\right]} \\
& {\left[\begin{array}{l}
x^{\prime} \\
y^{\prime} \\
z^{\prime}
\end{array}\right]=\left[\begin{array}{c}
1 \\
-3 \\
2
\end{array}\right]} \\
&
\end{aligned} \nonumber \]
When rotated counterclockwise 90° around the
\(x\)
–axis, the vector
\(\left[\begin{array}{l}
1 \\
2 \\
3
\end{array}\right]\)
becomes \(\left[\begin{array}{l}
1 \\
-3 \\
2
\end{array}\right]\).
Using Technology
We can use technology to help us find the rotation. WolframAlpha evaluates the trig functions for us.
Go to www.wolframalpha.com
In Example
Now we will use WolframAlpha to rotate vector
\(\left[ \begin{array}{c} 1 \\ 2 \\ 3 \end{array} \right]\)
90° around the
\(y\)-
axis. We use the
\(y\)-
axis rotation matrix
\(\left[\begin{array}{ccc}
\cos \theta & 0 & \sin \theta \\
0 & 1 & 0 \\
-\sin \theta & 0 & \cos \theta
\end{array}\right]\).
To perform the rotation, enter Evaluate \([[\cos (90), 0, \sin (90)],[0,1,0],[-\sin (90), 0, \cos (90)]] *[1,2,3]\) into the entry field.
Both entries and rows are separated by commas as WA does not see spaces.
Wolframalpha tells you what it thinks you entered, then tells you its answer.
When rotated counterclockwise 90 \(\mathrm{{}^\circ}\) around the \(y\) –axis, the vector \(\left[ \begin{array}{c} 1 \\ 2 \\ 3 \end{array} \right]\) becomes \(\left[ \begin{array}{c} 3 \\ 2 \\ -1 \end{array} \right]\) .
Find the vector
\(\left[\begin{array}{l}
x^{\prime} \\
y^{\prime} \\
z^{\prime}
\end{array}\right]\)
that results when the vector
\(\left[ \begin{array}{c} x \\ y \\ z \end{array} \right]=\left[ \begin{array}{c} 1 \\ 2 \\ 3 \end{array} \right]\)
is rotated 45° counterclockwise around the
\(z\)-
axis.
Solution
Since we are rotating the vector around the \(z\) –axis, we use the \(z\)- axis rotation matrix
\[\left[\begin{array}{ccc}
\cos \theta & -\sin \theta & 0 \\
\sin \theta & \cos \theta & 0 \\
0 & 0 & 1
\end{array}\right] \nonumber \]
Using WolframAlpha with \(\left[\begin{array}{l}
x \\
y \\
z
\end{array}\right]=\left[\begin{array}{l}
1 \\
2 \\
3
\end{array}\right]\) and
\(\theta =45\mathrm{{}^\circ },\)
we get
When rotated counterclockwise 45° around the
\(z\)
–axis, the vector \(\left[\begin{array}{l}
1 \\
2 \\
3
\end{array}\right]\) becomes \(\left[\begin{array}{c}
-1 / \sqrt{2} \\
3 / \sqrt{2} \\
3
\end{array}\right]\).
Try these
Find the vector \(\left[\begin{array}{l}
x^{\prime} \\
y^{\prime} \\
z^{\prime}
\end{array}\right]\) that results when the given vector \(\left[\begin{array}{l}
x \\
y \\
z
\end{array}\right]\) is rotated the given angle \(\theta\) counterclockwise around the given axis.
\(\left[\begin{array}{l}
x \\
y \\
z
\end{array}\right]=\left[\begin{array}{l}
1 \\
1 \\
1
\end{array}\right]\) through 90° around the \(x\)-axis.
- Answer
-
\(\left[ \begin{array}{c} 1 \\ -1 \\ 1 \end{array} \right]\)
\(\left[\begin{array}{l}
x \\
y \\
z
\end{array}\right]=\left[\begin{array}{l}
1 \\
0 \\
1
\end{array}\right]\) through 45° around the \(z\)-axis.
- Answer
-
\(\left[ \begin{array}{c} \sqrt{2} \\ 0 \\ 1 \end{array} \right]\)
\(\left[\begin{array}{l}
x \\
y \\
z
\end{array}\right]=\left[\begin{array}{l}
3 \\
4 \\
5
\end{array}\right]\) through 30° around the \(y\)-axis
- Answer
-
\(\left[ \begin{array}{c} 3 \\ -5 \\ 4 \end{array} \right]\)