Professional Documents
Culture Documents
hw01 2015 Sol
hw01 2015 Sol
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 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 .
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
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