Chapter 6
Linear Transformations
6.1 Matrix as a Function (Transformation)
6.2 Geometric Meaning of Linear Transformations
6.3 Kernel and Range
6.4 Composition of Linear Transformations and Invertibility
6.5*Computer Graphics with Sage
Exercises
So far, we have considered matrix mainly as a coefficient matrix from systems of linear equations. Now, we consider a matrix as a function.
We have observed that the set of vectors together with two operations reborn as an algebraic structure, namely a subspace(vector space).
Matrix will be reborn as a linear transformation, which is a function that preserves the operations in a vector space.
And linear transformations are used for noise filtering in signal processing and analysis in engineering processes.
We show a linear transformation from dimensional space to dimensional space can be expressed as a matrix .
We shall also look at geometric meaning of linear transformations from to and applications in computer graphics.
6.1 Matrix as a Function (Transformation)
Reference video: https://youtu.be/KHTR69HDSNs http://youtu.be/YF6ENHfI6E
Practice site: http://matrix.skku.ac.kr/knouknowls/claweek8Sec61.html
Matrix can be considered as a special function with the property of linearity.
Such a function play an important role in science and various areas in daily life,
such as mathematics, physics, engineering control theory, image processing, sound signal, and computer graphics.
What is a Transformation?
Definition 
[Transformation] 






A function, whose input and output are both vectors, is called a transformation. For a transformation , is called an image of by , and is called a preimage of .
As a special case of transformations, , for some matrix and a vector , is called a matrix transformation. 






[Remark] 
Computer simulation 






[Matrix transformation) http://www.geogebratube.org/student/b73259#material/22419








Definition 
[Linear Transformation] 






If a transformation from to , satisfies the following two conditions for any vectors and for any scalar ,
(1) (2)
then is called a linear transformation from to . Especially, a linear transformation from to itself, is called a linear operator on . 






Show that is a linear transformation if we define , for any vector in , as follows
For any two vectors , in and for any scalar ,
(1)
.
(2) .
Therefore, by definition, is a linear transformation from to . ¡á
Let, . Show that T is a linear transformation.
For any two vectors and in and for any scalar ,
(1)
.
(2)
Therefore, T is a linear transformation. ¡á
This type of linear transformation is called orthogonal projection on plane.
If we define as follows, show that is not a linear transformation.
.
For any two vectors, , in ,
.
However,
. Hence .
Therefore, we conclude that is not a linear transformation. ¡á
[Remark] 
Special Linear Transformations 






zero transformation: For any , if we define as , then is a linear transformation. This is called a zero transformation.
identity transformation: For any , if we define as , then is a linear transformation. This is called an identity transformation.
matrix transformation: For any matrix and for any vector in , if we define , then is a linear transformation from to . This is called a matrix transformation. 







Let is defined as follows. Show is a linear transformation.
For any two vectors in and for any scalar ,
(1)
(2)
and hence, is a linear transformation. ¡á
A linear transformation from is
,
is a matrix transformation for a matrix . ¡á
Theorem 6.1.1 [Properties of Linear Transformation] 

If is a linear transformation, then it satisfies the following conditions:
(1) . (2) . (3) . 
(1) Since , .
(2)
(3) ¡á
Each linear transformation from to can be expressed as a matrix transformation.
Let be any linear transformation. For elementary unit vectors,
of and for any , we have
and as , , , are matrix, we can write them as
.
Therefore any linear transformation can be expressed as
(1)
Now let be an matrix which has , , , as it's columns.
Then,
.
The above matrix is called the standard matrix of and is denoted by .
Hence, the standard matrix of the linear transformation given by (1) can be found easily from
the column vectors by substituting the elementary unit vectors to in that order.
Theorem 6.1.2 [Standard Matrix] 

If is a linear transformation, then the standard matrix of T has the following relation for .
,
where . 
For a linear transformation , ,
by using the standard matrix of , rewrite it as .
Let , which columns are , then
as .¡à
¡Ü http://matrix.skku.ac.kr/RPG_English/6MAstandardmatrix.html
x, y, z = var('x y z')
h(x, y, z) = [x+2*y, xy, z, x+z]
T = linear_transformation(QQ^3, QQ^4, h) # define LT
C = T.matrix(side='right') # standard matrix
x0 = vector(QQ, [2, 3, 3])
print C
print T.domain() # domain
print T.codomain() # codomain
print T(x0) # image
print C*x0 # product of standard matrix and a vector
[ 1 2 0]
[1 1 0]
[ 0 0 1]
[ 1 0 1]
Vector space of dimension 3 over Rational Field
Vector space of dimension 4 over Rational Field
(4, 1, 3, 5)
(4, 1, 3, 5) ¡á
6.2 Geometric Meaning of Linear Transformations
Reference video: https://youtu.be/hJXsKubtgms https://youtu.be/cgySDjOVlM
Practice site: http://matrix.skku.ac.kr/knouknowls/claweek8Sec62.html
In this section, we study the geometric meaning of linear transformations.
For a given image, continuous showing of series of images with small variations makes a motion picture.
Linear transformation can be applied to computer graphics and numerical algorithms, and it is an essential tool for many areas such as animation.
Linear Transformation from to
A linear transformation defined by moves a vector
to an another vector .
[rotation, symmetry, orthogonal projection]
We illustrate a few linear transformations on .
(1) is a linear transformation which rotates a vector in counterclockwise by around the origin.
(2) An orthogonal projection on axis is a linear
transformation.
(3) A symmetric movement around axis is a linear transformation.
¡á
¡Ü http://matrix.skku.ac.kr/sglee/LT/11.swf
Find the standard matrix for a linear transformation which moves a point in
to a symmetric image around the given line.
(1) axis (2) line
Symmetric (linear) transformation around axis and the line are given in the following figures.
,
, . ¡á
¡Ü http://matrix.skku.ac.kr/sglee/LT/22.swf
¡Ü http://matrix.skku.ac.kr/sglee/LT/44.swf
[Remark] Simulation 







[linear transformation] http://www.geogebratube.org/student/m9703 [symmetric transformations and orthogonal projection transformations] http://www.geogebratube.org/student/m9910 [rotation]







Linear transformation which moves any vector in to a symmetric image around a line,
which passes through the origin with angle between the axis and the line,
can be expressed by the following matrix presentation .
. ¡á
In , if , , i.e. .
As shown in the picture, let us define an orthogonal projection as a linear transformation (linear operator)
which maps any vector in to the orthogonal projection on a line,
which passes through the origin with angle between the axis and the line.
Let us denote the standard matrix correspond to is .
(the same direction with a half length)
¡á
In , if , is a projection onto the axis.
[Remark] 
shear transformations (computer simulation) 






(1) : shear transformation along the axis with scale (2) : shear transformation along the axis with scale
¡Ü http://www.geogebratube.org/student/m9912








Definition [Isometry] 







A linear transformation , which preserve the magnitude (or length of a vector), , is called Euclidean isometry. 






Theorem 6.2.1 

For a linear operator , the following statements are equivalent:
(1) , [isometry]. (2) , [preserve the dot (inner) product]. 
Definition [Orthogonal matrix] 







For a square matrix , if then is called an orthogonal matrix. 






For any real number , is an orthogonal matrix, and . ¡á
Verify the following matrices are orthogonal matrix.
,
Verify , by using the Sage. ¡à
¡Ü http://matrix.skku.ac.kr/RPG_English/6TForthogonalmatrix.html
A=matrix(QQ, 2, 2, [3/5, 4/5, 4/5, 3/5])
B=matrix(3, 3, [1/sqrt(3), 1/sqrt(2), 1/sqrt(6),
1/sqrt(3), 1/sqrt(2), 1/sqrt(6),
1/sqrt(3), 0, 2/sqrt(6)])
print A.transpose()*A # confirm the orthogonal matrix
print B.transpose()*B
[1 0] [1 0 0]
[0 1] [0 1 0]
[0 0 1] ¡á
Theorem 6.2.2 

For any matrix , the following statements hold:
(1) The transpose of an orthogonal matrix is an orthogonal matrix. (2) The inverse of an orthogonal matrix is an orthogonal matrix. (3) The product of orthogonal matrices is an orthogonal matrix. (4) If is an orthogonal matrix, then or . 
(1) and (2) are left as an exercise to the reader.
(3) If and , then
and hence is an orthogonal matrix.
(4) Observe that
or . ¡á
Theorem 6.2.3 

For any matrix , the following statements are equivalent:
(1) is an orthogonal matrix. (2) , . (3) , . (4) The row vectors of are orthonormal. (5) The column vectors of are orthonormal. 
(1) (2):
(2) (3):
and
.
Hence .
(3) (1): ,
(Kronecker's delta)
We skip the detailed proof of (4) and (5) as we can get the result easily
from the definition of the orthogonal matrix, , and (1). ¡á
6.3 Kernel and Range
Reference video: https://youtu.be/vMulGT9RiI0 http://youtu.be/9YciT9Bb2B0
Practice site: http://matrix.skku.ac.kr/knouknowls/claweek8Sec63.html
We will show that the subset of a domain , which maps to zero vector by a linear transformation,
becomes a subspace. We will also show the set of images under any linear transformation forms a subspace in the codomain.
Finally, we introduce the concept of isomorphism.
Definition [Kernel] 







Let be a linear transformation. The set of all vectors in , whose image becomes by , is called kernel of and is denoted by .
That is, . 






Find the for a linear transformation where .
. ¡á
Find the for a linear transformation , where .
For any ,
,
and hence, . ¡á
Definition [onetoone] 







For a transformation , if , then it is called onetoone (injective). 






Definition [onto] 







For a transformation , if there exist for any given , such that , then it is called onto (surjective). 






Theorem 6.3.1 

Let and are vector spaces and is a linear transformation. Then is onetoone if and only if . 
As , and is onetoone,
is onetoone. ¡á
Let us define a linear transformation as . Is onetoone?
As ,
the only element in this set is .
Hence , and is onetoone. ¡á
Is a linear transformation onetoone if it is defined as
?
Since ,
the system of linear equations has infinitely many solutions.
Hence, and by theorem 6.3.1, is not onetoone. ¡à
¨ç Verify whether a linear transformation is onetoone or not
U = QQ^3 # vector space
x, y, z = var('x, y, z')
h(x, y, z) = [x+2*yz, y+z, x+y2*z]
T = linear_transformation(U, U, h) # generate a linear transformation
print T.is_injective() # check the onetoone
False
¨è Find the Kernel of the linear transformation
T.kernel() # verify by finding kernel
Vector space of degree 3 and dimension 1 over Rational Field
Basis matrix:
[ 1 –1/3 1/3] # kernel = span( [1, 1/3, 1/3] ). ¡á
Let be an matrix. If we define a linear transformation as ,
then is a solution space of the system of linear equations .
Theorem 6.3.2 

Let are vector spaces and is a linear transformation. Then is a subspace of . Hence the subspace is called a kernel. 
is a subspace of . ¡á
Find the kernel of when with .
A = matrix(2, 2, [1, 1, 1, 1])
print A.right_kernel() # kernel of A
Free module of degree 2 and rank 0 over Integer Ring
Echelon basis matrix:
[] # kernel has only a Zero vector ¡á
Definition [Isomorphism] 







For a linear transformation , the set of all for , is called range of and is denoted by . That is,
.
Especially, if then is called surjective or onto.
If a linear transformation is onetoone and onto, then and is called an isomorphism from to . 






Find the range of the linear transformation .
. Note that, is not surjective. ¡á
is not an isomorphism as it is not surjective.
Let and
. It is easy to see that both and are subspaces of .
If we define as the following linear transformation,
then is both onetoone and onto, and hence it is an isomorphism. ¡á
Theorem 6.3.3 

For a linear transformation , is a subspace of . 
, such that ()
,
is a subspace of . ¡á
Let be an matrix, if we define a linear transformation as ,
then is a column space of .
Let , that is, be an matrix 's th column vector.
Then for any vector ,
.
That is, any image can be expressed as a linear combination of column vectors of .
¡á
Theorem 6.3.4 

For a linear transformation defined by a matrix satisfies the following two properties. (1) is onetoone. column vectors of are linearly independent. (2) is onto. row vectors of are linearly independent. 
(1) is onetoone
There is a unique which satisfies .
column vectors of are linearly independent.
(2) is onto
For 's column vectors ,
In RREF, the number of leading ones is .
row rank of is .
row vectors of are linearly independent. ¡á
Verify the following by using the Sage.
(1) Let . is onetoone but not onto.
¨ç define a linear transformation
U = QQ^2
V = QQ^3
A = matrix(QQ, [[1, 0], [0, 1], [0, 0]])
T = linear_transformation(U, V, A, side='right')
# linear transformation
print T
Vector space morphism represented by the matrix:
[1 0 0]
[0 1 0]
Domain: Vector space of dimension 2 over Rational Field
Codomain: Vector space of dimension 3 over Rational Field
¨è check the surjectivity (onto)
print T.image() # generate the range
print T.is_surjective() # check the surjectivity (onto)
Vector space of degree 3 and dimension 2 over Rational Field
Basis matrix:
[1 0 0]
[0 1 0]
False
¨é check the injectivity (onetoone)
print T.kernel() # generate the kernel
print T.is_injective() # check the injectivity (onetoone)
Vector space of degree 2 and dimension 0 over Rational Field
Basis matrix:
[]
True
(2) Let . is onto but not onetoone.
¨ç define a linear transformation
U = QQ^3
V = QQ^2
A = matrix(QQ, [[1, 0, 0], [0, 1, 0]])
T = linear_transformation(U, V, A, side='right')
# linear transformation
print T
Vector space morphism represented by the matrix:
[1 0]
[0 1]
[0 0]
Domain: Vector space of dimension 3 over Rational Field
Codomain: Vector space of dimension 2 over Rational Field
¨è check the surjectivity (onto)
print T.image() # generate the range
print T.is_surjective() # check the surjectivity (onto)
Vector space of degree 2 and dimension 2 over Rational Field
Basis matrix:
[1 0]
[0 1]
True
¨é check the injectivity (onetoone)
print T.kernel() # generate the kernel
print T.is_injective() # check the injectivity (onetoone)
Vector space of degree 3 and dimension 1 over Rational Field
Basis matrix:
[0 0 1]
False ¡á
Theorem 6.3.5 

Let be an matrix. If is a linear transformation, is onetoone if and only if is onto. 
is onetoone
There is a unique which satisfies .
In 's RREF, number of leading ones is .
For 's column vectors ,
is onto ¡á
Invertible Matrix theorem
Theorem 6.3.6 [Invertible Matrix Theorem] 

Let be an matrix, the following statements are all equivalent.
(1) column vectors of are linearly independent. (2) row vectors of are linearly independent. (3) has only trivial solution . (4) For any vector , has a unique solution. (5) and are column equivalent. (6) is invertible. (7) (8) is not an eigenvalue of . (9) is onetoone. (10) is onto. 
6.4 Composition of Linear Transformations and Invertibility
Reference video: https://youtu.be/AfjRcIxZQk http://youtu.be/EOlq4LouGao
Practice site: http://matrix.skku.ac.kr/knouknowls/claweek8Sec64.html
In this section, we study the composition of two or more linear transformations as continuous product of matrices.
We also study the geometric properties of linear transformation by connecting inverse functions and inverse matrices.
Theorem 6.4.1 [Composition of Functions] 

If both and are linear transformations, then the composition
is also a linear transformation. 
Theorem 6.4.2 

For linear transformations and , (1) is onetoone implies is onetoone. (2) is onto implies is onto. 
(1) If , for all , then .
( is onetoone)
¡Å is onetoone.
(2) If is onto, then for , there exist such that .
That is, there exist which satisfy .
Since , there exist such that .
¡Å is onto. ¡á
For the case of composition of two linear transformations,
the corresponding standard matrix is the product of two standard matrices from each linear transformation.
That is, let , and
has a standard matrix , has standard matrix .
Then the linear transformation has the standard matrix
.
Let the standard matrix of a linear transformation be .
If an inverse transformation exist, then the standard matrix of is the inverse of the matrix .
Let are linear transformations which rotate and (counterclockwise)
respectively around the origin. The corresponding standard matrices are as follows.
,
As the composition of these two transformations rotates around the origin,
the standard matrix of is as follows.
.
Also the product of standard matrices of and are as follows.
. ¡á
As shown in the picture, find a matrix transformation which transform a circle with radius 1 to the given ellipse.
First we find a transformation which expands 3 times around the axis, and expands 2 times around the axis.
Then take a transformation which rotates around the origin.
The first transformation is , and
hence the standard matrices for and the rotation transformation are
, .
Therefore, the standard matrix for the composition is the product of two standard matrices.
. ¡á
[Remark] Computer simulation 







[Matrix Transformation] http://www.geogebratube.org/student/m57556








Similarly a composition of three or more linear transformations,
the standard matrix of the composition is the product of each standard matrix in that operation order.
Theorem 6.4.3 

A function is invertible if and only if is onetoone and onto. 
Theorem 6.4.4 

If a linear transformation is invertible, then is also a linear transformation. 
Inverse transformation of composition of transformation:
[Remark] Computer simulation 







[ Scaling (expanding and compressing) transformation] http://www.geogebratube.org/student/m11366







6.5 *Computer Graphics with Sage
Reference video: http://youtu.be/VV5zzeYipZs
Practice site: http://matrix.skku.ac.kr/LabBook/SageLabManual2.htm
http://matrix.skku.ac.kr/BigLA/LABigBookCG.htm
Computer graphics plays a key role in automotive design, flight simulation, and game industry.
For example, a 3 dimensional object, such as automobile, its data (coordinates of points) can be described as a matrix.
If we transform the location of these points, we can redraw the transformed object from the points which are newly generated.
If this transformation is linear, we can easily obtain the transformed data by matrix multiplication.
In this section, we review several geometric transformations which are used in computer graphics.
Geometric meaning of Linear Transformation 1
(Linear Transformation of Polygon¡¯s Image)
By using the Sage, draw a triangle with three vertices , , and ,
a triangle expanded twice, a figure by a shear transformation along the axis with scale 1, and a triangle which is rotated counterclockwise by .
First of all, in order to define the above linear transformations, we input the following linear transformations by using matrix.
def matrix_transformation(A, L): n=matrix(L).nrows() # list L¡¯s number of elements L2=[[0,0] for i in range(n)] # define a new list L2 for i in range(n): L2[i]=list(A*vector(L[i])) # L2=A*L return L2 # return L2 print "The matrix_transformation function is activated"#confirm whether it is applied 
Then, we define appropriate standard matrices to fit the problems¡¯ condition.
A=matrix([[2,0], [0,2]]) # Expanding twice of given image B=matrix([[1,1], [0,1]]) # shear transformation along the axis with scale 1 C=matrix([[cos(pi/3), sin(pi/3)], [sin(pi/3), cos(pi/3)]]) # rotate counterclockwise the given image by 
Draw a triangle which has three vertices , , by using ploygon.
L1=list( [ [0,0], [0,3], [3,0] ]) # input three vertices SL1=polygon(L1, alpha=0.3, rgbcolor=(1,0,0)) # draw a polygon which passes through the given three points SL1.show(aspect_ratio=1, figsize=3) 
Draw a twice expanded triangle from the given triangle.
L2=matrix_transformation(A, L1) # find new three points by a linear transformation SL2=polygon(L2, alpha=0.8, rgbcolor=(0,0,1)) # draw a polygon which passes through the given three points SL2.show(aspect_ratio=1, figsize=3) 
Draw a shear transformed figure along the axis with scale 1 from the given triangle.
L3=matrix_transformation(B, L1) # find new three points by a linear transformation SL3=polygon(L3, alpha=0.8, rgbcolor=(1,0,1)) # draw a figure which passes through the given three points SL3.show(aspect_ratio=1, figsize=3) 
Draw a figure which is rotated counterclockwise by from the given triangle.
L4=matrix_transformation(C, L1) # find new three points by a linear transformation SL4=polygon(L4, alpha=0.4, rgbcolor=(0,0,1)) # draw a figure which passes through the given three points SL4.show(aspect_ratio=1, figsize=3) 
Show the above four figures in the same frame.
(SL1+SL2+SL3+SL4).show(aspect_ratio=1, figsize=3) 
Geometric meaning of Linear Transformation 2
(Linear Transformation of Line¡¯s Image)
Draw the alphabet letter on the plane. Then draw figures which expands the original figure twice,
sheer transforms along the axis with scale 1, and rotates counterclockwise by .
First of all, in order to define the above linear transformations, we input the following linear transformations by using matrix.
def matrix_transformation(A, L): n=matrix(L).nrows() # list L¡¯s number of elements L2=[[0,0] for i in range(n)] # define a new list L2 for i in range(n): L2[i]=list(A*vector(L[i])) # L2=A*L return L2 # return L2 print "The matrix_transformation function is activated"#confirm whether it is applied 
Then, we define appropriate standard matrices to fit the problems¡¯ condition.
A=matrix([[2,0], [0,2]]) # Expanding twice of given image B=matrix([[1,1], [0,1]]) # shear transformation along the axis with scale 1 C=matrix([[cos(pi/3), sin(pi/3)], [sin(pi/3), cos(pi/3)]]) # rotate counterclockwise the given image by 
Draw an alphabet letter S by using the line function.
L1=list( [ [0,0], [4,4], [3,12], [0,15], [3,12], [4,12], [0,16], [4,12], [3,4], [0,1], [3,4], [4,4], [0,0] ]) # input the data which compose letter SL1=line(L1, color="red") # draw a figure which passes through the given points SL1.show(aspect_ratio=1, figsize=5) 
Draw a twice expanded letter S from the given figure.
L2=matrix_transformation(A, L1) # compute new points¡¯ coordinates by a linear transformation SL2=line(L2, color="purple") #draw a figure which passes through the given points SL2.show(aspect_ratio=1, figsize=5) 
Draw a sheer transformed figure along the axis with scale 1 from the given S.
L3=matrix_transformation(B, L1) # compute new points¡¯ coordinates by a linear transformation SL3=line(L3, color="blue") # draw a figure which passes through the given points SL3.show(aspect_ratio=1, figsize=5) 
Draw a figure which is rotated counterclockwise by from the given letter S.
L4=matrix_transformation(C, L1) # compute new points¡¯ coordinates by a linear transformation SL4=line(L4, color="green") #draw a figure which passes through the given points SL4.show(aspect_ratio=1, figsize=5) 
Show the above four figures in the same frame.
(SL1+SL2+SL3+SL4).show(aspect_ratio=1, figsize=5) 