回転行列

反時計回りに角度θだけ回転させる回転行列は
$$\begin{eqnarray}
R(\theta) = \left(
\begin{array}{cc}
~\cos \theta & -\sin \theta \\
\sin \theta & \cos \theta
\end{array}
\right)
\end{eqnarray}$$
と表され、(x, y)が(x’, y’)に移動する時、
$$x’=x\cos \theta – y\sin \theta\\
y’=x\sin \theta + y\cos \theta$$
というように(x’, y’)を計算できます。