Application of Linear Transformation in Computer Graphics PDF
Application of Linear Transformation in Computer Graphics PDF
LINEAR
TRANSFORMATIONS
6.1 Introduction to Linear Transformations
6.2 The Kernel and Range of a Linear Transformation
6.3 Matrices for Linear Transformations
6.4 Transition Matrices and Similarity
6.5 Applications of Linear Transformations
T : V mapping
W , V ,W : vector space
V: the domain of T
W: the codomain of T
the range of T:
The set of all images of vectors in V.
the preimage of w:
The set of all v in V such that T(v)=w.
T (u v ) T (u1 v1 , u 2 v2 )
((u1 v1 ) (u 2 v2 ), (u1 v1 ) 2(u 2 v2 ))
((u1 u 2 ) (v1 v2 ), (u1 2u 2 ) (v1 2v2 ))
(u1 u 2 , u1 2u 2 ) (v1 v2 , v1 2v2 )
T (u) T ( v )
Elementary Linear Algebra: Section 6.1, p.299 7/103
(2) Scalar multiplica tion
cu c(u1 , u 2 ) (cu1 , cu2 )
T (cu) T (cu1 , cu2 ) (cu1 cu2 , cu1 2cu2 )
c(u1 u 2 , u1 2u 2 )
cT (u)
Therefore, T is a linear transformation.
(c) f ( x) x 1
f ( x1 x2 ) x1 x2 1
f ( x1 ) f ( x2 ) ( x1 1) ( x2 1) x1 x2 2
f ( x1 x2 ) f ( x1 ) f ( x2 ) f ( x ) x 1 is not
Elementary Linear Algebra: Section 6.1, p.300 linear transformation 9/103
Notes: Two uses of the term “linear”.
3 0 6
2
T ( v) Av 2 1 3
1
1 2 0
T (2,1) (6,3,0)
(b) T (u v) A(u v) Au Av T (u) T ( v) (vector addition)
T ( v) Av
T : Rn
R m
Elementary Linear Algebra: Section 6.1, p.302 14/103
Ex 7: (Rotation in the plane)
Show that the L.T. T : R 2 R 2 given by the matrix
cos sin
A
sin cos
has the property that it rotates every vector in R2
counterclockwise about the origin through the angle .
Sol:
v ( x, y) (r cos , r sin ) (polar coordinates)
r: the length of v
:the angle from the positive
x-axis counterclockwise to
the vector v
Elementary Linear Algebra: Section 6.1, p.303 15/103
cos sin x cos sin r cos
T ( v) Av
sin cos sin
y cos r sin
r cos cos r sin sin
r sin cos r cos sin
r cos( )
r sin( )
r:the length of T(v)
+:the angle from the positive x-axis counterclockwise to
the vector T(v)
Thus, T(v) is the vector that results from rotating the vector v
counterclockwise through the angle .
19/103
Keywords in Section 6.1
function: 函數
domain: 論域
codomain: 對應論域
image of v under T: 在T映射下v的像
range of T: T的值域
preimage of w: w的反像
linear transformation: 線性轉換
linear operator: 線性運算子
zero transformation: 零轉換
identity transformation: 相等轉換
20/103
6.2 The Kernel and Range of a Linear Transformation
Kernel of a linear transformation T:
Let T : V W be a linear transformation
Then the set of all vectors v in V that satisfy T ( v) 0 is
called the kernel of T and is denoted by ker(T).
ker(T ) {v | T ( v) 0, v V }
ker(T ) {0}
T ( x1 , x2 , x3 ) (0,0)
x1
1 1 2 0
1 2 x2
3 0
x3
x1 t 1
x2 t t 1
x3 t 1
range(T ) {T ( v) | v V }
T (u v) T (u) T ( v) range(T ) ( u V , v V u v V )
T (cu) cT (u) range(T ) (u V c u V )
(1, 2, 1, 0), (2, 1, 0, 0), (1, 1, 0, 2)is a basis for the range of T
Note:
Let T : R n R m be the L.T. given by T (x) Ax, then
rank (T ) rank ( A)
nullity (T ) nullity ( A)
46/103
Keywords in Section 6.2
kernel of a linear transformation T: 線性轉換T的核空間
range of a linear transformation T: 線性轉換T的值域
rank of a linear transformation T: 線性轉換T的秩
nullity of a linear transformation T: 線性轉換T的核次數
one-to-one: 一對一
onto: 映成
isomorphism(one-to-one and onto): 同構
isomorphic space: 同構的空間
47/103
6.3 Matrices for Linear Transformations
Two representations of the linear transformation T:R3→R3 :
2 1 1 x1
(2)T (x) Ax 1 3 2 x2
0 3 4 x3
Three reasons for matrix representation of a linear transformation:
It is simpler to write.
It is simpler to read.
It is more easily adapted for computer use.
(1) The standard matrix for the zero transformation from Rn into Rm
is the m n zero matrix.
(2) The standard matrix for the zero transformation from Rn into Rn
is the n n identity matrix In.
Elementary Linear Algebra: Section 6.3, p.322 54/103
Composition of T1:Rn→Rm with T2:Rm→Rp :
T ( v) T2 (T1 ( v)), v R n
T T2 T1 , domain of T domain of T1
T ( v ) T2 (T1 ( v )) T2 ( A1 v ) A2 A1 v ( A2 A1 ) v
Note:
T1 T2 T2 T1
1 1 0 2 1 0 2 1 0
A A2 A1 0 0 1 0 0 0 1 0 1
0 1 0 1 0 1 0 0 0
The standard matrix for T ' T1 T2
2 1 0 1 1 0 2 2 1
A' A1 A2 0 0 0 0 0 1 0 0 0
1 0 1 0 1 0 1 0 0
Note:
If the transformation T is invertible, then the inverse is
unique and denoted by T–1 .
(1) T is invertible.
(2) T is an isomorphism.
(3) A is invertible.
Note:
If T is invertible with standard matrix A, then the standard
matrix for T–1 is A–1 .
1 I
A1
0 0 1 6 2 3
Therefore T is invertible and the standard matrix for T 1 is A1
1 1 0
A1 1 0 1
6 2 3
1 1 0 x1 x1 x2
T 1 ( v) A1 v 1 0 1 x2 x1 x3
6 2 3 3 1
x 6 x 2 x 2 3 x3
In other word s,
T 1 ( x1 , x2 , x3 ) ( x1 x2 , x1 x3 , 6 x1 2 x2 3 x3 )
Elementary Linear Algebra: Section 6.3, p.325 62/103
the matrix of T relative to the bases B and B':
T :V W (a L.T. )
B {v1 , v2 ,, vn } (a basis for V )
B' {w1 , w2 ,, wm } (a basis for W )
If T : V W is a L.T. s.t.
a11 a12 a1n
a a a
T ( v1 )B ' 21 , T ( v 2 )B ' 22 ,, T ( v n )B ' 2 n
am1 am 2 amn
Check:
T (2, 1) (2 1, 2(2) 1) (3, 3)
Elementary Linear Algebra: Section 6.3, p.327 67/103
Notes:
(1)In the special case where V W and B B' ,
the matrix A is alled the matrix of T relative to the basis B
(2)T : V V : the identity t ransformat ion
B {v1 , v2 , , vn } : a basis for V
the matrix of T relative to the basis B
1 0 0
0 1 0
A T (v1 )B , T (v2 )B , , T (vn )B In
0 0 1
69/103
Keywords in Section 6.3
standard matrix for T: T 的標準矩陣
composition of linear transformations: 線性轉換的合成
inverse linear transformation: 反線性轉換
matrix of T relative to the bases B and B' : T對應於基底B到
B'的矩陣
matrix of T relative to the basis B: T對應於基底B的矩陣
70/103
6.4 Transition Matrices and Similarity
T :V V ( a L.T. )
B {v1 , v2 ,, vn } ( a basis of V )
B' {w1 , w2 , , wn } (a basis of V )
A T (v1 )B , T (v2 )B ,, T (vn )B ( matrix of T relative to B)
A' T (w1 )B' , T (w2 )B' ,, T (wn )B' (matrix of T relative to B' )
P w1 B , w2 B ,, wn B ( transitio n matrix from B' to B )
P 1 v1 B ' , v2 B ' ,, vn B ' ( transitio n matrix from B to B' )
(2)(indirect)
P 1 AP[ v ]B ' [T ( v )] B '
A' P 1 AP
direct
2 1 3 7
or T ( v )B ' A' v B '
1 3 1 0
Elementary Linear Algebra: Section 6.4, p.331 76/103
Similar matrix:
For square matrices A and A‘ of order n, A‘ is said to be
similar to A if there exist an invertible matrix P s.t. A' P1 AP
Thm 6.13: (Properties of similar matrices)
Let A, B, and C be square matrices of order n.
Then the following properties are true.
(1) A is similar to A.
(2) If A is similar to B, then B is similar to A.
(3) If A is similar to B and B is similar to C, then A is similar to C.
Pf:
(1) A I n AI n
(2) A P 1 BP PAP1 P( P 1 BP ) P 1
PAP1 B Q 1 AQ B (Q P 1 )
Elementary Linear Algebra: Section 6.4, p.332 77/103
Ex 4: (Similar matrices)
2 2 3 2
(a) A and A' are similar
1 3 1 2
1 1 1
because A' P AP, where P
0 1
2 7 2 1
(b) A and A' are similar
3 7 1 3
1 3 2
because A' P AP, where P
2 1
d1k 0 0 d1 0 0
0 d 2k 0 0 d2 0
(1) D
k
D
0 0 d nk 0 0 d n
(2) DT D
d11 0 0
0 1
0
(3) D 1 d2
, d i 0
0 0 1
dn
82/103
Keywords in Section 6.4
matrix of T relative to B: T 相對於B的矩陣
matrix of T relative to B' : T 相對於B'的矩陣
transition matrix from B' to B : 從B'到B的轉移矩陣
transition matrix from B to B' : 從B到B'的轉移矩陣
similar matrix: 相似矩陣
83/103
6.5 Applications of Linear Transformations
Elementary matrices for linear transformations in R2:
k 0 x kx
0 1 y y
b. Vertical contractions
and expansions
T ( x, y ) ( x, ky)
1 0 x x
0 k y ky
a. Horizontal shear
T ( x, y) ( x ky, y)
1 k x x ky
0 1 y y
T ( x, y ) ( x 2 y, y )
Under this transformation, points in the upper half-plane “shear” to
the right by amounts proportional to their y-coordinates. Points in
the lower half-plane “shear” to the left by amounts proportional to
the absolute values of their y-coordinates. Points on the x-axis do
not move by this transformation.
Elementary Linear Algebra: Section 6.5, p.338 87/103
b. Vertical shear
T ( x, y) ( x, y kx)
1 0 x x
k 1 y kx y
T ( x, y) ( x, y 2 x)
Here, points in the right half-plane “shear” upward by amounts
proportional to their x-coordinates. Points in the left half-plane
“shear” downward by amounts proportional to the absolute values
of their x-coordinates. Points on the y-axis do not move.
Sol:
a. A rotation of 60
cos 60 sin 60 0 1 2 3 2 0
A sin 60 cos 60 0 3 2 12 0
0 0 1 0 0 1
c. A rotation of 120
95/103
Keywords in Section 6.5
reflection: 鏡射
expansion: 擴展
contraction: 縮減
share: 切變
rectangular prism: 長方體
96/103
6.1 Linear Algebra Applied
Multivariate Statistics