You are on page 1of 7

Applications of Linear Transformation

I. Computer Graphics:

Example:

1. Reflection with respect to x-axis:

 u   u  1 0 u1   u1 
L : R2 → R2 , L  1   = A 1  =     = .
 u2   u2  0 −1u2  − u2 
For example, the reflection for the triangle with vertices (− 1, 4 ), (3, 1), (2, 6 ) is

 − 1   − 1   3   3    2   2 
L    =   , L    =   , L    =   .
  4   − 4  1  − 1  6   − 6
The plot is given below.

(2, 6)

(− 1, 4)

(3, 1)

(3, − 1)
(− 1, − 4)

(2, − 6)

2. Reflection with respect to y = − x :

1
 u1   u1   0 −1u1  − u2 
L : R → R , L    = A  = 
2 2
u  = − u .
u u
  2   2   − 1 0  2   1 
Thus, the reflection for the triangle with vertices (− 1, 4 ), (3, 1), (2, 6 ) is

 − 1   − 4  3   − 1   2   − 6 
L    =   , L    =   , L    =   .
  4    1   1   − 3  6   − 2

The plot is given below

(2, 6)

(− 1, 4)

(3, 1)
(− 4, 1)

(− 1, − 3)

(− 6, − 2)

3. Rotation:

 u   u  cos(θ ) − sin(θ )u1 


L : R2 → R2 , L  1   = A 1  =  u 
u u
  2   2   sin(θ ) cos(θ )  2 
For example, as θ = π ,
2

cos π
A= 2
( ) ( 2 ) = 0
− sin π − 1
π
 sin 2 ( ) cos (π )  1
2 
 0  .

Thus, the rotation for the triangle with vertices (0, 0 ), (1, 0 ), (1, 1) is

2
 0  0 − 1 0 0
L    =   0  = 0  , .
0
   1 0    
 1   0 − 1 1  0
L    =    0  = 1  ,
  0    1 0    
and

 1  0 − 1 1  − 1
L    =   1 =  1 .

 1  1 0    
The plot is given below.

(0, 1)
(1, 1)
(− 1, 1)

(0, 0) (1, 0)

4. Shear in the x-direction:

 u1   u1 + ku2 


L : R → R , L    = 
2 2
, k ∈ R.
u
  2   2 u
For example, as k = 2 ,

 u   u + 2u2 
L  1   =  1 
u
  2   2  u
Thus, the shear for the rectangle with vertices (0, 0 ), (0, 2 ), (4, 0 ), (4, 2 ) in the
x-direction is

 0   0    0    4    4    4    4   8 
L    =   , L    =  , L    =   , L    =   .
 0   0    2    2    0    0    2    2 

3
The plot is given below.

(4, 2) (8, 2)
(0, 2)

(0, 0) (4, 0)

II. Cryptography:

Suppose we want to send the following message to our friend,

MEET TOMORROW.
For the security, we first code the alphabet as follows:
A B … X Y Z
1 2 … 24 25 26

Thus, the code message is


MEET TOMORROW
M E E T T O M O R R O W
13 5 5 20 20 15 13 15 18 18 15 23

The sequence
13 5 5 20 20 15 13 15 18 18 15 23
is the original code message. To encrypt the original code message, we can apply a
linear transformation to original code message. Let

L : R 3 → R 3 , L(x ) = Ax,
where

4
1 2 3
A =  1 1 2  .
 0 1 2 
Then, we break the original message into 4 vectors first,

13 20 13 18


 5 , 20, 15, 15
       ,
 5  15 18 23
and use the linear transformation to obtain the encrypted code message

 13  13 1 2 3 13 38


 
L  5   = A 5  = 1 1 2  5  = 28 ,
 5   5  0 1 2  5  15 
 

 20  20 1 2 3 20 105


 
L 20  = A20 = 1 1 2 20 =  70 
 15   15  0 1 2 15   50 
 

 13  13 1 2 3 13 97


 
L 15  = A15 = 1 1 2 15 = 64 ,
 18  18 0 1 2 18  51
 
and

 18  18 1 2 3 18 117


 
L 15  = A15 = 1 1 2 15 =  79  .
 23  23 0 1 2 23  61 
 
Then, we can send the encrypted message code
38 28 15 105 70 50 97 64 51 117 79 61

Suppose our friend wants to encode the encrypted message code. Our friend can find
the inverse matrix of A first,

5
−1
1 2 3  0 1 − 1
A−1 = 1 1 2 =  2 − 2 − 1
0 1 2 − 1 1 1 

and then
38  0 1 − 1 38 13
A−1 28 =  2 − 2 − 1 28 =  5  ,
15  − 1 1 1  15   5 

105  0 1 − 1 105 20


A−1  70  =  2 − 2 − 1  70  = 20 ,
 50  − 1 1 1   50  15 
97  0 1 − 1 97 13
A−1 64 =  2 − 2 − 1 64 = 15
 51 − 1 1 1   51 18
and
117  0 1 − 1 117 18 
A−1  79  =  2 − 2 − 1  79  = 15 
 61  − 1 1 1   61  23
Thus, our friend can find the original message code
13 5 5 20 20 15 13 15 18 18 15 23
via the inverse matrix of A.

Similarly, if we receive the following message code from our friend


77 54 38 71 49 29 68 51 33 76 48 40 86 53 52
and we know the message from our friend transformed by the same linear
transformation

1 2 3
L : R3 → R3 , L( x ) = Ax = 1 1 2 x.
0 1 2

6
Thus, we first break the message into 5 vectors,

77 71 68 76 86


54, 49, 51, 48, 53
         ,
38 29 33 40 52
and then the original message code can be obtained by
77  0 1 − 1 77 16
A−1 54 =  2 − 2 − 1 54 =  8  ,
38 − 1 1 1  38 15
 71  0 1 − 1  71 20
A−1 49 =  2 − 2 − 1 49 = 15  ,
29 − 1 1 1  29  7 
68  0 1 − 1 68 18
A−1 51 =  2 − 2 − 1 51 =  1  ,
33 − 1 1 1  33 16
76  0 1 − 1 76  8 
A−1 48 =  2 − 2 − 1 48 = 16 ,
40 − 1 1 1  40 12
and
86  0 1 − 1 86  1 
A−1 53 =  2 − 2 − 1 53 = 14 .
52 − 1 1 1  52 19

Thus, the original message from our friend is


16 8 15 20 15 7 18 1 16 8 16 12 1 14 19
P H O T O G R A P H P L A N S
PHOTOGRAPH PLANS

You might also like