banner.gif
On-Line Computer Graphics Notes
DEVELOPMENT OF THE ROTATION MATRIX


Overview

The 3-dimensional rotation matrix, when rotating about one of the coordinate axes is quite similar to the $ 3 \times 3$ rotation matrix developed for rotation in two-dimensions. Here rotation is much simpler to describe, as rotation is about a point in two-dimensions. Here we develop the rotation matrix in two-dimensions that rotates a point about the origin in the Cartesian frame.

pdficonsmall.gif For a pdf version of these notes look here.


In Two Dimensions

In two dimensions, one rotates about a point. We will rotate about the origin, and will consider our 2-d frame to be the two-dimensional Cartesian frame. Consider the following figure

\includegraphics {figures/2d-rotation-1}

where we depict a rotation of $ \theta$ units about the origin and the point $ (x,y)$ is rotated into the point $ (x',y')$. By considering the following figure,

\includegraphics {figures/2d-rotation-2}

we note that $ (x,y)$ can be written in polar coordinates as

$\displaystyle (x,y) \: = \: (r\cos\phi, r\sin\phi)$    

and also that $ (x',y')$ can be written in polar coordinates as

$\displaystyle (x',y') \: = \: (r\cos(\phi+\theta), r\sin(\phi+\theta))$    

Expanding the description of $ (x',y')$, we obtain

$\displaystyle (x',y')$ $\displaystyle = (r\cos(\phi+\theta), r\sin(\phi+\theta))$    
  $\displaystyle = (r\cos\phi\cos\theta - r\sin\phi\sin\theta, r\sin\phi\cos\theta + r\cos\phi\sin\theta )$    
  $\displaystyle = (x\cos\theta - y\sin\theta, x\sin\theta + y\cos\theta )$    

which can be written in matrix form as

$\displaystyle \left[ \begin{array}{ccc} x & y & 1 \end{array} \right] \left[ \b...
...in\theta & 0 \\  -\sin\theta & \cos\theta & 0 \\  0 & 0 & 1 \end{array} \right]$    

So in 2-dimensions, rotation is implemented as a $ 3 \times 3$ matrix given by

$\displaystyle \left[ \begin{array}{ccc} \cos\theta & \sin\theta & 0 \\  -\sin\theta & \cos\theta & 0 \\  0 & 0 & 1 \end{array} \right]$    


Summary

Rotation about the origin in two-dimensions is given by a simple $ 3
\times 3$ matrix written in terms of the cosine and sine of the angle of rotation. This development can be applied directly to develop the rotation matrices for the three-dimensional rotations about the X, Y and Z axes.


Return to the Graphics Notes Home Page
Return to the Geometric Modeling Notes Home Page
Return to the UC Davis Visualization and Graphics Group Home Page


This document maintained by Ken Joy

Mail us your comments

All contents copyright (c) 1996, 1997, 1998, 1999
Computer Science Department
University of California, Davis

All rights reserved.


Ken Joy
1999-12-06