In this explainer, we will learn how to find the matrix of linear transformation and the image of a vector under transformation.
Linear algebra provides an invaluable tool kit for computation tasks such as solving a system of linear equations or finding the inverse of a square matrix. Given that these tasks usually involve a large number of calculations, it is often the case that the geometric interpretation is underappreciated. Linear algebra is a genuine oddity in that it is possible to understand this entire discipline with multiple, distinct perspectives, each of which has its own merits and its own way of understanding this vast and elegant subject. A criminally overlooked perspective for new students of linear algebra is the one in which we think of matrices as a way of transforming vectors, hence offering us a well-developed tool kit to start describing (linear) spatial geometry.
Vectors are special types of matrices which can be split into two categories: row vectors and column vectors. A row vector is a matrix of order , which has 1 row and columns, whereas a column vector is a matrix of order which has rows and 1 column. Although convention differs from source to source, it is arguably most sensible to think only in terms of column vectors. There are two reasons for this: column vectors are used more often and can be related to row vectors by transposition if needed; and column vectors are possible to combine with matrices under matrix multiplication on the left-hand side (which is also simply a matter of arbitrary convention but for some reason it just feels better).
In geometry, a (column) vector having entries would be referred to as an -dimensional vector and these objects are used to represent points in -dimensional space. For example, consider the two-dimensional vectors
We can represent these vectors in diagrammatic form as shown in the figure, where the first entry in each vector corresponds to the -coordinate and the final entry corresponds to the -coordinate. This is all fine and well and, in likelihood, it is probably a familiar concept to those who have already become interested for whatever reason in the higher art of linear algebra. We will not spend any time revising what a vector is or how it can be represented diagrammatically, but instead we will focus on what it is that we can do with vectors within the construct of linear algebra.
Suppose that we had decided that the previous vectors and , whilst interesting, were something that we wanted to modify. Any previous study of mathematics will give some clues as to what options we have available: rotation, reflection, translation, dilation, and so on. In fact, most of these options are simply special cases of a much more powerful route: using matrix multiplication to change the vectors. To demonstrate what we mean, we consider the vectors and as stated above, and additionally we also take the matrix
The matrix multiplication is well defined so long as has order and has order . The resulting matrix is of order . Suppose now that we were to consider the matrix products and ; then, from the dimensionality of the matrix and both vectors, we know that this will result in two new vectors and that will be of order , hence having the same dimension as the original two vectors. Specifically, by completing the correct matrix multiplication, we would obtain and
To better understand how the original vectors have changed, we now plot everything on the same axis as shown in the figure.
As we can see, the original vectors have been transformed by the matrix and to notably different effect. In having taken the original vectors and and multiplying them on the left-hand side by the matrix , we say that we have performed a “linear transformation” on the original vectors to achieve the new vectors and . Given that is a matrix, there were 4 entries whose values could be fixed, meaning that there are many possible linear transformations available to us. For example, suppose that we considered the new matrix and the same vectors that we used above:
Then, by defining the new vectors and , we obtain the following:
These are the two vectors after having performed the linear transformation represented by the matrix . We have plotted these new vectors in the figure.
As we can clearly see, the new vectors and are different to those that were obtained using the previous linear transformation, as shown in the figure. Quite obviously, the two output vectors and are different in both of these diagrams, despite the original vectors being the same. This is because of differences in the two matrices that were used to define the linear transformations.
At this stage, it should be becoming clear that linear transformations can be used to describe a large number of ways that we might wish to transform a set of vectors. When attempting to describe these in a visual sense, the result can quickly become confusing and intractable due to the large number of vectors that might be involved. There is a simple visual trick that can help enormously with this: instead of connecting every vector to the origin, we connect every vector only to one of the other vectors (in a particularly helpful order). Suppose that we took the three vectors and the linear transformation that is represented by the matrix
Then, the vectors after this transformation would be
In the figure, we have shown how to better represent the linear transformation by connecting the three given vectors as a quadrilateral where the fourth vertex is the origin.
The orange quadrilateral is prior to the linear transformation and the blue quadrilateral is after this transformation has been performed. In this sense we can obtain a better visualization as to how the linear transformation acts on the 2 dimensional space that it alters. This method of describing the linear transformation is clearly superior to the previous diagrammatic method, where every vector was connected to the origin.
Although we could have defined any set of three vectors , , and to generate a diagram of the above type, in practice, we often find ourselves returning to a standard set of input vectors that will allow us to get a snapshot of the linear transformation. Suppose that we kept the linear transformation as defined by the previous matrix but instead choose the set of vectors
These vectors describe a square with side length 1 that has one vertex at the origin and is contained within the upper-right quadrant of the plane. After applying the linear transformation, we find the modified vectors
As shown in the figure, the unit square has been stretched and rotated in a way that is difficult to describe precisely but is easier to understand in a visual sense.
From this, we can deduce that the effect of the linear transformation is that, in some way, the order of the corners and is “flipped” while the effect on is more akin to a dilation of the original vector. This is still by no means a perfect description of the linear transformation and for this there is no other alternative to the statement of the matrix which defined this.
In being able to choose any values for each of the 4 entries that comprise a matrix, we have access to an infinite number of linear transformations on two-dimensional vectors. There are of course many subcategories as to the type of linear transformation that we can perform, for example, rotations, dilations, and reflections. Before these can be understood fully and before the significance of the underlying algebraic structure can be revealed, it is necessary that we practice this idea to ensure that we can first perform the linear transformation that is defined by any matrix.
Example 1: Linear Transformation of Two-Dimensional Vectors
Consider the linear transformation described by the matrix
Let us also define the quadrilateral with one vertex at the origin and the three remaining corners described by the vectors
Plot a diagram to show the effect of the given linear transformation on the given quadrilateral.
We complete the matrix multiplications , , and to produce the vectors that we need to complete the diagram. The calculation for is
The calculations for and are completed in the same way: and
The resulting quadrilateral is shown in the figure, wherein the effect of the given linear transformation is demonstrated by connecting the three vectors , , and to the origin in order.
In choosing the origin and the 3 particular vectors we have actually made life much simpler for ourselves. As we can verify from every previous example where the vectors take these values, the vector is simply the first column of the matrix and the vector is just the second column of this matrix. The vector can then always be written as . Not only does this approach allow us to describe the effect of the linear transformation on the given quadrilateral without having to perform any matrix multiplication, it also shows how we can generate a matrix that achieves any desired effect on and , with the effect on being a consequence of this.
For example, suppose for some very good reason that we wanted to take the vectors defined above and apply a linear transformation to and to give the new vectors
This will place in the lower-left quadrant of the plane and in the lower-right quadrant of the plane. There is only one option for the matrix that achieves this, given how we have defined and :
We could either use the relationship or directly complete the calculation to find that
Given that we now have , , and without having performed any calculation other than addition, we can plot the graph as shown in the figure. The effect is exactly as we had expected, with and appearing in the quadrants that we predicted. Please note that we could have picked any two of the three original vectors , , and and then used the relationship to find the third vector after the linear transformation. We only initially considered the vectors and because this meant that we could immediately populate the two columns of the matrix without having to perform any calculations. Had we instead chosen as one of the two initial vectors, then generally we would have had no option but to first complete the matrix multiplication .
Example 2: Linear Transformation of Two-Dimensional Vectors
What is the matrix that sends the points , , and to the points , , and as shown?
By looking at the figure, we can see that the three initial vectors are
After the linear transformation has been applied, there are the three resultant vectors
Given our choice of the vectors and , it is immediately apparent that the matrix must be the concatenation of the two column vectors and :
We can check that this is the case for any of the vectors , , and . We will choose only the vector , from which we can check that
We can check that and using the equivalent calculation as given above.
Normally, the standard vectors are used for questions of this type because the transformation of these points, especially and , is straightforward to understand. This removes the need to complete any matrix multiplication or any other arithmetic beyond the two instances of simple addition that are used to find . The vectors and have one entry, that is, 1, with the other entry being 0, meaning that it is little effort to infer the form of the matrix that encodes the specified linear transformation. If the given initial vectors are not as simple as in the equation above, then more work will be needed to determine the linear transformation.
Example 3: Linear Transformation of Two-Dimensional Vectors
Find the matrix of the transformation that maps the points , , and onto , , and as shown in the figure.
By examining the figure, we see the original set of points in orange are as follows:
After the linear transformation has been applied, we have the points as colored on the graph in blue:
The matrix that represents this linear transformation has order and to this we will assign the variable . Given that we do not yet know the form of , we express the matrix with unknown entries:
We can then use any of the equations that link together the initial set of points with the set of points after the linear transformation has been applied. We could choose to use any two of the three relations , , and . With no obvious reason to select any of the three points as favorable, we begin with the relationship . Writing this out in full gives the matrix equation
We can check that the matrix multiplication in this equation is well defined, meaning that if there was any situational advantage then we could complete this operation. Fortunately, there is such an advantage, so we complete the matrix multiplication in the above equation to obtain the two equations:
This is half of the information needed to answer the problem by finding the values of , , , and . To complete this process, we need to use one of the two remaining relationships: and . With no obvious advantage to choosing either of these, we select . Writing this out in full gives the matrix equation
Completing the matrix multiplication gives
Now we compare equations (1) and (2). Notice that the left-hand equations of each of these feature the entries and , which means that we can solve the simultaneous equations and to give and . By then comparing the right-hand side of equations (1) and (2), we get the two expressions and . This gives and , meaning that the full matrix can be written as
We can check that this is the correct matrix by ensuring that , which is the only one of the three given relationships that we have not yet used. We do indeed find that this equation is honored by the transformation matrix , since it is the case that
Example 4: Linear Transformation of Two-Dimensional Vectors
Find the matrix of the transformation that maps the points , , and onto , , and as shown in the figure.
The initial set of points are and after the linear transformation these points have been mapped to the following points:
We will represent the demonstrated linear transformation by the matrix and we must determine the value of the entries such that , , and . We will only need two of these relationships, and we begin with the equation . This requires solving the equation which can be expanded as two equations by the definition of matrix multiplication:
Then, we use the relationship to give the matrix equation
Completing the matrix multiplication gives the two equations:
There are several techniques that can be used to find the values of the entries in a way that is more succinct, but for the moment we can take the two left-side equations from (3) and (4) to find and , as well as taking the two right-side equations to calculate and . Whatever the method, the values that we find are and and also and