2D Computer Graphics - in Two Dimensions

In Two Dimensions

In two dimensions every rotation matrix has the following form:


R(\theta) = \begin{bmatrix}
\cos \theta & -\sin \theta \\
\sin \theta & \cos \theta \\
\end{bmatrix}.

This rotates column vectors by means of the following matrix multiplication:


\begin{bmatrix}
x' \\
y' \\
\end{bmatrix} = \begin{bmatrix}
\cos \theta & -\sin \theta \\
\sin \theta & \cos \theta \\
\end{bmatrix}\begin{bmatrix}
x \\
y \\
\end{bmatrix}.

So the coordinates (x',y') of the point (x,y) after rotation are:

,
.

The direction of vector rotation is counterclockwise if θ is positive (e.g. 90°), and clockwise if θ is negative (e.g. -90°).


R(-\theta) = \begin{bmatrix}
\cos \theta & \sin \theta \\
-\sin \theta & \cos \theta \\
\end{bmatrix}\,.

Read more about this topic:  2D Computer Graphics

Famous quotes containing the word dimensions:

    The truth is that a Pigmy and a Patagonian, a Mouse and a Mammoth, derive their dimensions from the same nutritive juices.... [A]ll the manna of heaven would never raise the Mouse to the bulk of the Mammoth.
    Thomas Jefferson (1743–1826)