Rotation and shear mapping of Linear algebra

I created simple examples of the rotation and shear mapping of linear algebra for understanding.

My examples this repository.

This visualized example was very helpful for understanding eigenvectors and eigenvalues.

Rotation

The rotation uses below rotation matrix.
\[
A = \begin{bmatrix}
\cos\theta & -\sin\theta \\
\sin\theta & \cos\theta
\end{bmatrix}
\]

A rotated vector is represented like this;

\[
rotatedVector =
\begin{bmatrix}
\cos\theta & -\sin\theta \\
\sin\theta & \cos\theta
\end{bmatrix} v
\]

E.g.

\[
\begin{bmatrix}
\cos90 & -\sin90 \\
\sin90 & \cos90
\end{bmatrix}
\begin{bmatrix}
1 \\
1
\end{bmatrix}
=
\begin{bmatrix}
0 & -1 \\
1 & 0
\end{bmatrix}
\begin{bmatrix}
1 \\
1
\end{bmatrix}
=
\begin{bmatrix}
-1 \\
1
\end{bmatrix}
\]

Example

This is my example code.

Origin image here.

original image

Rotate it 90 degrees.

ratated

Shear mapping

The shear mapping uses below matrix.
\[
A = \begin{bmatrix}
1 & 1 \\
0 & 1
\end{bmatrix}
\]

A sheer mapping vector is represented like this;

\[
shearedVector =
\begin{bmatrix}
1 & 1 \\
0 & 1
\end{bmatrix} v
\]

E.g.

\[
\begin{bmatrix}
1 & 1 \\
0 & 1
\end{bmatrix}
\begin{bmatrix}
1 \\
1
\end{bmatrix}
=
\begin{bmatrix}
2 \\
1
\end{bmatrix}
\]

The x-axis of the vecter is increased, but the y-axis is not changed. Any other vectors are the same behaviou​r​, only the x-a​xis values are changed.

Example

This is my example code.

Sheard image.

sheard image

Leave a Reply

Your email address will not be published. Required fields are marked *