Chapter 4 Linear Transformations 4.2 Matrix Representations of Linear Transformations 2.3 Additional topics Theorem If ๐ฟ is a linear transformation mapping โ๐ into โ๐ , then there is an ๐ × ๐ matrix ๐ด, such that ๐ฟ(๐ฑ) = ๐ด๐ฑ for each x ∈ โ๐ . In fact, the ๐๐กโ column vector of ๐ด is given by ๐๐ = ๐ฟ(๐๐ ) ๐ = 1,2, … , ๐ Proof For ๐ = 1,2, … , ๐, define ๐๐ = ๐ฟ(๐๐ ), and let ๐ด = ๐๐๐ = (๐1 , ๐2 , … , ๐๐ ). If ๐ฑ = ๐ฅ1 ๐1 + ๐ฅ2 ๐2 + โฏ + ๐ฅ๐ ๐๐ is an arbitrary element of โ๐ , then ๐ฟ ๐ฑ = ๐ฅ1 ๐ฟ ๐1 + ๐ฅ2 ๐ฟ ๐2 + โฏ + ๐ฅ๐ ๐ฟ ๐๐ = ๐ฅ1 ๐1 + ๐ฅ2 ๐2 + โฏ + ๐ฅ๐ ๐๐ = ๐ด๐ฑ Theorem The theorem tells us how to construct the matrix ๐ด corresponding to a linear transformation ๐ฟ. To get the ๐๐กโ column of ๐ด, see what ๐ฟ does to the basis element ๐๐ of โ๐ . Since the standard basis elements ๐1 , ๐2 , … , ๐๐ (the column vectors of the ๐ × ๐ identity matrix) are used for โ๐ , we refer to ๐ด as the standard matrix representation of ๐ฟ. Example Find the standard matrix representation for the linear transformation ๐ฅ+๐ฆ ๐ฅ ๐ฅ−๐ฆ 2 4 ๐ฟ: โ → โ given by ๐ฟ ๐ฆ = . 2๐ฅ + 2๐ฆ ๐ฅ Solution ๏ First compute ๐ฟ ๐1 and ๐ฟ ๐2 : 1 = (1,1,2,1)๐ 0 0 ๐ฟ ๐2 = ๐ฟ = (1, −1,2,0)๐ 1 Therefore, we have standard matrix representation: 1 1 ๐ด = 1 −1 2 2 1 0 ๐ฟ ๐1 = ๐ฟ ๏ Example Rotation Matrix for โ2 Let ๐ฟ: โ2 → โ2 be the linear operator that rotates each vector by an angle ๐ in the counterclockwise direction. Then a matrix representation for ๐ฟ is given by cos ๐ −sin ๐ ๐ด= sin ๐ cos ๐ Matrix Representation Theorem(MRT) If ๐ธ = {๐ฏ1 , ๐ฏ2 , … , ๐ฏn } and ๐น = {๐ฐ1 , ๐ฐ2 , … , ๐ฐm } are ordered bases for vector spaces ๐ and ๐, respectively. Then corresponding to each linear transformation ๐ฟ: ๐ → ๐, there is an ๐ × ๐ matrix ๐ด such that [๐ฟ(๐ฏ)]๐น = ๐ด[๐ฏ]๐ธ for each v ∈ ๐ ๐ด is the matrix representing ๐ฟ relative to the ordered bases ๐ธ and ๐น. In fact, ๐๐ = [๐ฟ(๐ฏ๐ )]๐น ๐ = 1,2, … , ๐ Proof of MRT(outline) Firstly: for ∀ ๐ฏ ∈ ๐, there is a unique representation under the basis ๐ธ = {๐ฏ1 , ๐ฏ2 , โฏ , ๐ฏn }, we can write it as ↔ ๐= ๐ฏ๐ธ ๐ฏ = ๐ฅ1 ๐ฏ1 + ๐ฅ2 ๐ฏ2 + โฏ + ๐ฅ๐ ๐ฏ๐ Similarly, ๐ฟ ๐ฏ ∈ ๐,๐น = ๐ฐ1 , ๐ฐ2 , … , ๐ฐm is a basis set of W, we have L(๐ฏ) = ๐ฆ1 ๐1 + ๐ฆ2 ๐2 + โฏ + ๐ฆ๐ ๐๐ ↔ ๐ = L(๐ฏ) ๐น According to the definition of linear transformation , ๐ฟ ๐ผ๐ฏ1 + ๐ฝ๐ฏ2 = ๐ผ๐ฟ ๐ฏ1 + ๐ฝ๐ฟ(๐ฃ2 ) L ๐ฏ = ๐ฟ ๐ฅ1 ๐ฏ1 + ๐ฅ2 ๐ฏ2 + โฏ + ๐ฅ๐ ๐ฏ๐ = ๐ฅ1 ๐ฟ(๐ฏ1 ) + ๐ฅ2 ๐ฟ(๐ฏ2 ) + โฏ + ๐ฅ๐ ๐ฟ(๐ฏ๐ ) Proof of MRT(outline) L ๐ฏ = ๐ฟ ๐ฅ1 ๐ฏ1 + ๐ฅ2 ๐ฏ2 + โฏ + ๐ฅ๐ ๐ฏ๐ = ๐ฅ1 ๐ฟ(๐ฏ1 ) + ๐ฅ2 ๐ฟ(๐ฏ2 ) + โฏ + ๐ฅ๐ ๐ฟ(๐ฏ๐ ) ๐ฟ ๐ฏ๐ ∈ ๐,๐น = ๐ฐ1 , ๐ฐ2 , … , ๐ฐm is a basis set of W, we have L(๐ฏj ) = ๐1๐ ๐1 + ๐2๐ ๐2 + โฏ + ๐๐๐ ๐๐ ↔ ๐j = L(๐ฏj ) ๐น j=1,2,…,n L ๐ฏ = ๐ฅ1 ๐ฟ(๐ฏ1 ) + ๐ฅ2 ๐ฟ(๐ฏ2 ) + โฏ + ๐ฅ๐ ๐ฟ(๐ฏ๐ ) ๐ ๐ L ๐ฏ = ๐ฅ๐ ๐ฟ(v๐ ) = ๐=1 ๐ = ๐ฅ๐ ๐=1 ๐ ๐ ๐๐๐ ๐ฐ๐ = ๐=1 ๐ ๐ ๐๐๐ ๐ฐ๐ ๐ฅ๐ = ๐=1 ๐=1 ๐๐๐ ๐ฐ๐ ๐ฅ๐ ๐=1 ๐=1 ๐ ๐ฐ๐ ๐=1 ๐ ๐๐๐ ๐ฅ๐ ๐=1 = L(๐ฏ) = ๐ฆ1 ๐1 + ๐ฆ2 ๐2 + โฏ + ๐ฆ๐ ๐๐ Proof of MRT(outline) Because, the coordinate for a given basis set is unique, compare ๐ ๐ ๐ฐ๐ ๐=1 ๐๐๐ ๐ฅ๐ = L(๐ฏ) = ๐ฆ1 ๐1 + ๐ฆ2 ๐2 + โฏ + ๐ฆ๐ ๐๐ ๐=1 ๐ We have ๐ฆ๐ = ๐๐๐ ๐ฅ๐ = ๐๐1 ๐ฅ1 + ๐๐2 ๐ฅ2 + โฏ + ๐๐๐ ๐ฅ๐ , i = 1,2, … , ๐ ๐=1 That is: ๐ = ๐ด๐, for ๐ด ∈ ๐ ๐×๐ ๐ฟ ๐ฏ ๐น Recall that ๐ = ๐ฏ =๐ด๐ฏ ๐ = L(๐ฏ) ๐ธ ๐ธ L(๐ฏj ) = ๐1๐ ๐1 + ๐2๐ ๐2 + โฏ + ๐๐๐ ๐๐ ↔ ๐j = L(๐ฏj ) ๐น j=1,2,…,n ๐น Theorem L(๐ฏj ) = ๐1๐ ๐1 + ๐2๐ ๐2 + โฏ + ๐๐๐ ๐๐ ๐1๐ ๐2๐ ๐ฟ ๐ฏ๐ = [๐ค1 , ๐ค2 , … , ๐ค๐ ] โฎ ๐๐๐ ↔ ๐j = L(๐ฏj ) ๐น j=1,2,…,n = ๐น๐j If ๐ธ = {๐ฏ1 , ๐ฏ2 , … , ๐ฏn } and ๐น = {๐ฐ1 , ๐ฐ2 , … , ๐ฐm } be ordered bases for โ๐ and โ๐ , respectively. If ๐ฟ: โ๐ → โ๐ is a linear transformation and ๐ด is the matrix representing ๐ฟ w.r.t. ๐ธ and ๐น, then ๐๐ = ๐น −1 ๐ฟ ๐๐ ๐ = 1,2, … , ๐ Where ๐น = {๐ฐ1 , ๐ฐ2 , … , ๐ฐm } Example Let ๐ฟ be the linear transformation mapping โ3 to โ2 defined by ๐ฟ ๐ฑ = ๐ฅ1 ๐1 + (๐ฅ2 + ๐ฅ3 )๐2 For each ๐ฑ ∈ โ3 , where 1 −1 ๐1 = and ๐2 = 1 1 Find the matrix ๐ด representing ๐ฟ with respect to the ordered bases {๐1 , ๐2 , ๐3 } and {๐1 , ๐2 }. Proof ๏ ๐ฟ ๐1 = 1๐1 + 0๐2 , ๐ฟ ๐2 = 0๐1 + 1๐2 , ๐ฟ ๐3 = 0๐1 + 1๐2 ๏ The ๐๐กโ column of ๐ด is determined by the coordinates of ๐ฟ ๐๐ w.r.t. {๐1 , ๐2 }. Thus 1 0 0 ๐ด= 0 1 1 Corollary If ๐ด is the matrix representing the linear transformation ๐ฟ: โ๐ → โ๐ with respect to the bases ๐ธ = {๐1 , ๐2 , … , ๐๐ } and ๐น = {๐1 , ๐2 , … , ๐๐ } then the reduced row echelon form of (๐1 , ๐2 , … , ๐๐ |๐ฟ ๐1 , … , ๐ฟ ๐๐ ) is ๐ผ|๐ด . Proof ๏ Let ๐ต = (๐1 , ๐2 , … , ๐๐ ). The matrix ๐ต|๐ฟ ๐1 , … , ๐ฟ ๐๐ is row equivalent to ๐ต−1 ๐ต|๐ฟ ๐1 , … , ๐ฟ ๐๐ = ๐ผ ๐ต −1 ๐ฟ ๐1 , … , ๐ต −1 ๐ฟ ๐๐ = ๐ผ|๐1 , … , ๐๐ = ๐ผ|๐ด Example Let ๐ฟ: โ2 → โ3 be the linear transformation defined by ๐ฟ ๐ฑ = (๐ฅ2 , ๐ฅ1 + ๐ฅ2 , ๐ฅ1 − ๐ฅ2 )๐ Find the matrix representations of ๐ฟ with respect to the ordered bases {๐1 , ๐2 } and {๐1 , ๐2 , ๐3 }, where ๐1 = (1,2)๐ , ๐2 = (3,1)๐ and ๐1 = (1,0,0)๐ , ๐2 = (1,1,0)๐ , ๐3 = (1,1,1)๐ Solution First compute ๐ฟ ๐1 = (2,3, −1)๐ , ๐ฟ ๐2 = (1,4,2)๐ ๏ Transform matrix (๐1 , ๐2 , ๐3 |๐ฟ ๐1 , ๐ฟ ๐2 ) to the row echelon form ๏ 1 1 1 2 1 1 0 0 1 1 3 4 → 0 1 0 0 1 −1 2 0 0 0 −1 −3 0 4 2 1 −1 2 Revision Exercises Computer Graphics and Animation Computer Graphics and Animation • Four Basic Transformation Functions 1. Rotation 2. Dilation and contraction (Scaling) 3. Reflection • • w.r.t. y-axis w.r.t. x-axis 4. Translation (transposition) What are the transformation functions? Are they ALL linear transformation? 1. Rotation (Already mentioned) Rotation Matrix for โ2 Let ๐ฟR: โ2 → โ2 be the linear operator that rotates each vector by an angle ๐ in the counterclockwise direction. Then a matrix representation for ๐ฟR is given by cos ๐ −sin ๐ A๐ = sin ๐ cos ๐ e2 e1 2. Dilation and contraction (Scaling) Scaling Matrix for โ2 Let ๐ฟ๐: โ2 → โ2 be the linear operator that dilate or contract the any vector by c (scalar in โ ). To calculate A: 1) We evaluate ๐ฟ๐(e1) and ๐ฟ๐(e2) ๐ฟ๐ ๐1 = ๐ฟ๐ 1 0 = ๐ 0 2) Group the result vectors to form A. A๐ = 3) Check linearity ๐ 0 ๐ฟ๐ ๐2 = ๐ฟ๐ 0 1 = 0 ๐ ๐ฟ๐ ๐ฅ + ๐ฆ = ๐ ๐ฅ + ๐ฆ = ๐๐ฅ + ๐๐ฆ = ๐ฟ๐ ๐ฅ + ๐ฟ๐ ๐ฆ ๐ฟ๐ ๐๐ฅ = ๐๐ ๐ฅ = ๐๐ฟ๐ ๐ฅ i.e. Linear Transformation 0 ๐ 3. Reflection (Mirroring) 3A) Reflection Matrix for โ2 (y-axis) Let ๐ฟ๐ ๐ฆ: โ2 → โ2 be the linear operator Reflect any vector w.r.t. y-axis To calculate A: 1) We evaluate ๐ฟ๐ ๐ฆ(e1) and ๐ฟ๐ ๐ฆ(e2) ๐ฟ๐ ๐ฆ ๐1 = ๐ฟ๐ ๐ฆ 1 0 = −1 0 ๐ฟ๐ ๐ฆ ๐2 = ๐ฟ๐ ๐ฆ 2) Group the result vectors to form A. A๐ ๐ฆ = 3) Check linearity 0 1 = 0 1 −1 0 0 1 ๐ฅ +๐ฆ −1 ๐ฟ๐ ๐ฆ ๐ฅ + ๐ฆ = ๐ด๐ ๐ฆ ๐ฅ1 + ๐ฆ1 = 0 2 2 −๐ฅ1 −๐ฆ1 = ๐ฅ + ๐ฆ = ๐ฟ๐ ๐ฆ ๐ฅ + ๐ฟ๐ ๐ฆ ๐ฆ 1 ๐ฟ๐ ๐ฆ ๐๐ฅ = ๐ด๐ ๐ฆ −๐ฅ1 − ๐ฆ1 0 ๐ฅ1 + ๐ฆ1 = ๐ฅ2 + ๐ฆ2 1 ๐ฅ2 + ๐ฆ2 ๐๐ฅ1 ๐ฅ1 ๐๐ฅ2 = ๐๐ด๐ ๐ฆ ๐ฅ2 = ๐๐ฟ๐ ๐ฆ ๐ฅ i.e. Linear Transformation 4. Translation (Transposition) 4) Translation Matrix for โ2 Let ๐ฟ๐: โ2 → โ2 be the linear operator Translation of any vector to ๐′ = (๐ฅ1′ , ๐ฅ2′ ) To calculate A: 1) We evaluate ๐ฟ๐(e1) and ๐ฟ๐(e2) ๐ฟ ๐ ๐1 = ๐ฟ ๐ 1 0 1 + ๐ฅ1′ = ๐ฅ2′ 2) Group the result vectors to form A. 1 + ๐ฅ1′ A๐ = ๐ฅ2′ 3) Check linearity ๐ฟ ๐ ๐2 = ๐ฟ ๐ 0 1 ๐ฅ1′ 1 + ๐ฅ2′ ๐ฟ ๐ ๐ฅ + ๐ฆ = (๐ฅ + ๐ฆ) + ๐ฅ ′ = ๐ฅ + ๐ฆ + ๐ฅ ′ ๐ฟ ๐ ๐ฅ + ๐ฟ ๐ ๐ฆ = ๐ฅ + ๐ฅ ′ + ๐ฆ + ๐ฅ ′ = ๐ฅ + ๐ฆ + 2๐ฅ ′ i.e. non-Linear Transformation ๐ฅ1′ = 1 + ๐ฅ2′ Q 7. p188 Let 1 1 1 ๐ฆ1 = 1 , ๐ฆ2 = 1 , ๐ฆ2 = 0 1 0 0 and let I be the identity operator on โ3 . a) Find the coordinates of I(e1), I(e2), I(e3) w.r.t. {y1,y2,y3} b) Find a matrix A such that Ax is the coordinate vector of x w.r.t. {y1,y2,y3}. Solution: ๏ In order to simplify the process for the evaluation of the coordinates of I(e1), I(e2), I(e3) w.r.t. {y1,y2,y3}. ๏ It is wiser to calculate the transformation matrix A first (i.e. solution of b) and base on it to calculate these coordinates w.r.t. y. i. Identity operator is given by: ๐ช ๐ฃ =๐ฃ So we have: 1 0 0 ๐ช ๐1 = ๐1 = 0 , ๐ช ๐2 = ๐2 = 1 , ๐ช ๐3 = ๐3 = 0 0 0 1 By using corollary for the reduced row echelon form of : [B | L(u)] ๏จ [ I | A] to find A. So we have: 1 1 1 1 0 0 1 1 0 0 1 0 1 0 0 0 0 1 ๐ 1 ↔๐ 3 1 0 0 0 0 1 1 1 0 0 1 0 1 1 1 1 0 0 1 0 0 0 0 1 0 1 0 0 1 −1 . So. ๐ด = 0 0 1 1 −1 0 ๐ 2 −๐ 1 ๐ 3 −๐ 1 0 0 0 1 1 −1 1 0 0 1 −1 0 0 0 0 0 1 1 0 0 1 −1 1 1 1 0 −1 ๐ 3 −๐ 2 Solution: ii) And hence the coordinates are: ๐ช ๐1 0 = ๐ด๐1 = 0 1 0 1 −1 1 −1 0 1 0 0 = 0 0 1 ๐ช ๐2 0 = ๐ด๐2 = 0 1 0 1 −1 1 −1 0 0 0 1 = 1 0 −1 0 0 1 0 1 ๐ช ๐3 = ๐ด๐3 = 0 1 −1 0 = −1 1 −1 0 1 0 To verify the result, you can check: w.r.t. {y1,y2,y3}. 1 1 1 1 = 0 1 +0 1 +1 0 = 0 = ๐1 1 ๐ 0 ๐ 0 ๐ 0 ๐ ๐ฆ 1 1 0 0 1 1 = 0 1 +1 1 −1 0 = 1 = ๐2 −1 ๐ฆ 1 ๐ 0 ๐ 0 ๐ 0 ๐ 1 1 1 1 0 −1 = 1 1 −1 1 + 0 0 = 0 = ๐3 0 ๐ฆ 1 ๐ 0 ๐ 0 ๐ 1 ๐ 0 0 1 Homework Ex. 4.2 3(a, c), 5(a, d), 9(a, b), 15. Extra: 13, 19.