Matrices: Functions and Geometry - drnickmines/MinesLinearAlgebra GitHub Wiki
We've learned the basics of matrices and operations, especially matrix multiplication. Here, we will see a different way to interpret matrix multiplication. This leads to a set of matrices we can use for geometric representations of matrix multiplication.
The topics in this lesson are particularly useful in fields where we represent images, like computer graphics and 3D printing. In these fields, matrix multiplication is used to move, stretch, rotate, and visualize objects.
A function is an object that assigns an output for any given input. Here are two quick examples:
-
$\large f(x)=3x$ . This is a linear function that takes a real number as an input and spits out a real number as an output. We say$\large f: \mathbb{R}\rightarrow\mathbb{R}$ . -
$\large f(\vec{x}) = \left<x_1+x_2,2x_1,3x_2\right>$ , with$\large f:\mathbb{R}^2\rightarrow\mathbb{R}^3$ .
If we think about it, we can consider
Definition: We call the function
$\large A\vec{x}$ a linear transformation, and we typically write it as$\large T(\vec{x})$ . If$\large A$ is$\large m\times n$ , then$\large T:\mathbb{R}^n\rightarrow\mathbb{R}^m$ .
As an example, let's define
Then we can compute
Note
Thinking of matrix multiplication as a function lets us think of
The following are true for any linear transformation:
$\large T(\vec{0})=\vec{0}$ -
$\large T(a\vec{u}+b\vec{v})=aT(\vec{u})+bT(\vec{v})$ (this is the defining property of a linear transformation) - Any linear transformation from
$\large \mathbb{R}^n$ to$\large \mathbb{R}^m$ can be written as$\large T(\vec{x})=A\vec{x}$ .
As mentioned, in fields such as computer graphics, we use linear transformations to manipulate shapes and images. We'll learn a general principle for visualizing the effect of a matrix on a vector, and then we'll see two specific common transformations.
Principle: A linear transformation
$\large A$ is completely defined by what it does to the unit basis vectors. The first column of$\large A$ is where$\large A$ sends$\large \hat{\imath}$ , and the second column tells us exactly where$\large \hat{\jmath}$ lands.
Suppose we have the following
This matrix is the linear transformation that takes
There are a few linear transformations of note that we can visualize geometrically.
- A shear transformation:
By the guiding principle above, we see that
What does this mean for vectors that are not the standard unit basis vectors? If we take the points
Remember that we can think of
If the coordinates
- A rotation transformation:
What does this matrix do to vectors? Again, we return to the guiding principle. This
The image shows a set of three points (in red) and their transformed images in blue:
We see that
A more general rotation matrix is:
This matrix rotates vectors
Consider the product:
This is one transformation followed by another. It will first shear the vector and then will rotate it. In the language of linear transformations, this corresponds to a composition of functions. If we use
I can:
- Represent matrix multiplication as a linear transformation.
- Use the properties of linear transformations.
- Recognize and use shear and rotation matrices to transform vectors.