You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The coordinates $(x',y')$ of the point $(x,y)$ after rotation are:
$$
x' = x \cos \theta - y \sin \theta \\
y' = x \sin \theta + y \cos \theta
$$
See [rotation in 2D] for a visual proof.
Rotations in three dimensions
Rotations in three dimensions extend simply from two dimensions.
Consider a [right-handed] set of x, y, z axes, maybe forming the x axis with your right thumb, the y axis with your index finger, and the z axis with your middle
finger.
Now look down the z axis, from positive z toward negative z.
You see the x and y axes pointing right and up respectively, on a plane in front of you.
A rotation around z leaves z unchanged, but changes x and y according to the 2D rotation formula above:
For a rotation around x, we look down from positive x to the y and z axes,
pointing right and up, respectively. y replaces x in the 2D formula, and z
replaces y, to give:
$$
y' = y \cos \theta - z \sin \theta \\
z' = y \sin \theta + z \cos \theta
$$
Now consider a rotation around the y axis. We look from positive y down the
y axis to the z and x axes, pointing right and up respectively. $z$ replaces
$x$ in the 2D formula, and $x$ replaces $y$:
$$
z' = z \cos \theta - x \sin \theta \\
x' = z \sin \theta + x \cos \theta
$$
$\mathbf{M}$ is the rotation matrix that encodes a rotation by
$\gamma$ radians around the x axis followed by a rotation by
$\phi$ radians around the y axis. We know that the y axis rotation
follows the x axis rotation because matrix multiplication operates from right
to left.