You are on page 1of 3

HW1 – Numerical Analysis Solutions

Due 2015-4-17(Fri)

1 2 
1. [10pts]Let A= . Compute A10 using the matrix that diagonalizes A .
2 1 

1− λ 2
= (1 − λ ) 2 − 4 = λ2 − 2λ − 3 = (λ − 3)(λ + 1) . ∴ λ = 3, − 1
2 1− λ

1 1 1 1


i) λ = 3 : AX = 3 X . x + 2 y = 3x, 2 x + y = 3 y. x = y . X = k   or
   or
1 2 1 1
1 − 1 1 1
ii) λ = −1 : AX = − X . x + 2 y = − x, 2 x + y = − y. − x = y . X = k   or   or  
− 1 1 2 −1

1 1  3 0 
For P= 
−1
, P AP =  
−1 10 −1 −1 −1 −1
. ( P AP) = P APP AP  P APP AP
1 − 1 0 − 1

−1
1 1  310 0  1 1 1 
10
−1 1 1  3 0  1 1 
−1 −1
= P A P . A = P( P AP) P = 
10 10

10
   =    
1 − 1 0 − 1 1 − 1 1 − 1  0 (−1)10  2 1 − 1

1 310 + 1 310 − 1
=  10 .
2 3 − 1 310 + 1

2. [10pts]Let A = (2, 1, 1), B = (1, -1, 1), N = (1, 1, 3), P = (2, -1, 2), X = (x, y,
z). Compute the intersection between a line X=A+tB and a plane N ⋅ ( X − P) = 0 .

(1,1, 3) ⋅ (2, − 1, 2) − (1,1, 3) ⋅ (2,1,1) 7 − 6 1 1 1


N ⋅ ( A + tB − P) = 0 , t = = = , X = (2,1,1) + (1, − 1,1) = (7, 2, 4)
(1,1, 3) ⋅ (1, − 1,1) 3 3 3 3

3. [10pts]Let x − 2 y + 2 z + 3 = 0 be a plane equation and A = (4, 3, 1) be a point. Compute


the distance between the plane and the point A.
1 2 2  1 2 2 4−6+2+3
plane L =  , − , , 1 . distance d = L ⋅ A = * 4 − * 3 + *1 + 1 = = 1.
3 3 3  3 3 3 3

4. [10pts]Let A=(2, 1, 1), B=(1, -1, 1), C = (1, 1, 3). Compute the coordinates of P.

BA • BC (1, 2, 0) • (0, 2, 2) 4
BP = BC = (0, 2, 2) = (0, 2, 2) = (0,1,1) , P = B + BP = (1, − 1,1) + (0,1,1) = (1, 0, 2)
BC • BC (0, 2, 2) • (0, 2, 2) 8
5. [20pts]We want to make a house model in 2D space by transforming a unit sized
line segment A between [0 0]T and [1 0]T. When B is the left roof, which is a
line segment between [3 2]T and [5 3]T . Compute the transformation matrix M
which transforms A into B (use homogeneous coordinates).

 2 1 
 − 0
 5 0 0  5 5   1 0 3
  1 2   
S =0 5 0 , R =  0 , T = 0 1 2 . M = TRS
0 5 5
0 1   0 0 1
 
   0 0 1
 

6. [20pts]Suppose that we want to make a cockpit window in a flight simulation game.


Let P = (2, 2, 1) be the center of the cockpit window, the opposite direction of the
viewing direction be z ′ = (1 / 3, 2 / 3, 2 / 3) , and its up vector be y ′ = (2 / 3, 1 / 3, − 2 / 3) .
Suppose we have a bird at the position B = (1, 2, 1) in the sky. Compute the 2D position
of the bird in the cockpit window when we parallelly project it on the window.

X VRP = (2, 2, 1) , N = (1 / 3, 2 / 3, 2 / 3) , V = (2 / 3, 1 / 3, − 2 / 3) :
U = V × N = (2 / 3, − 2 / 3, 1 / 3)
RU = X , RV = Y , RN = Z , R[U V N]= I ,
2 2 1 
3 − 0
3 3 2 − 2 1 0
U  2  
1

2
0 1  2 1 − 2 0
R = [U V N ] = [U V N] = V  , R =  3 
−1
 = 3 1 2
T
  3 3
2 0
 N  1 2 2
0  
3 3 3  0 0 0 3
 0 0 0 1
1 0 0 − 2 2 − 2 1 0 1 0 0 − 2
0 0 − 2  0 0 0 − 2
1 1 2 1 −2 1
T = , M = RT =   
0 0 1 − 1 3 1 2 2 0 0 0 1 − 1
    
0 0 0 1 0 0 0 3 0 0 0 1
P = (1, 2, 1) . P′ in eye coordinates:
 2 − 2 1 0  1 0 0 − 2 1  2 − 2 1 0  − 1  − 2
  1 0 − 2 2 1 2 1 − 2
       − 2
1 2 1 − 2 0 0 0 0
  = 1  
P′ = MP =    = 
3 1 2 2 0 0 0 1 − 1  1  3 1 2 2 0  0  3  − 1 
        
0 0 0 3 0 0 0 1  1  0 0 0 3  1   3
 2 2 1
P′ =  − , − , − 
 3 3 3

 2 2
if we assume the parallel projection, 2D position = − , − 
 3 3

7. [20pts]Suppose that we want make a shadow of a statue in 3D space. P = (1, 1, 0 ) is the bottom position of the statue,
and the sun is in 30° vertically, in 45° horizontally from the x-axis counter-clock-wise. To make a shadow, we need to
rotate the statue at P by 90° so that the statue is aligned with the x-y plane, then scale it based on the vertical angle of the
sun, and then parallelly project onto the x-y plane. Compute the transformation matrix M for transforming the statue into its
shadow (use the homogeneous coordinates).
* sin 30° = 1 / 2, cos 30° = 3 / 2, sin 45° = 1 / 2 , cos 45° = 1 / 2

 1 1 
1 0 0 − 1  2 − 0 0 1 0 0 0 1 0 0 0
2
0 1 
0 − 1  1 1  0 0 
1 0 0 3 0 0
T = , RZ =  0 0 , R X =  , S=
0 0 1 0  2 2  0 − 1 0 0 0 0 1 0
   0 0 1 0    
0 0 0 1   0 0 0 1 0 0 0 1
 0 0 0 1

1 0 0 0
0 1 0 0
P= . M = PT −1 RZ−1SRX RZ T
0 0 0 0
 
0 0 0 1

You might also like