Sie sind auf Seite 1von 14

Foundations

of

Game Engine Development

VOLUME 1
MATHEMATICS

Solutions Guide

by Eric Lengyel

Updated August 11, 2017


2 Answers to Exercises

Chapter 1
1. (a) i j 0, j k 0, and k i 0.
(b) i j k , j i k , j k i, k j i , k i j, and i k j.
(c) i, j, k 1.

a b a b a b a 2 b 2 2a b . For the dot product, we can say


2
2.
2
a b a b cos a b , which means a b a 2 b 2 2 a b . The
right side of this inequality is a b , and taking square roots of both sides
2

gives us the result.

3. Similar to previous exercise.

a 2 b 2 2a b a 2 b 2 2 a b a b .
2 2
ab

4. Expanding each term with the vector triple product identity, we have
a b c b c a c a b
b a c c a b c b a a b c a c b b c a ,

and every term of the result cancels.

5. Note that b a b b a b . Applying the vector triple product identity, we


have b a b b 2 a a b b. Dividing by b 2 gives us
bab a b
2
a 2 b a a b a b .
b b

b y2 b z2 b x b y b x b z
1
6. R 2 b x b y b b
2
x
2
z b y b z .
b
b x b z b y b z b x2 b y2

7. Expanding v ab , we have
v a b
v a b v a b .
a b2
Since a b a 0, the entire last term disappears when we calculate
v ab a , and we are left with
Answers to Exercises 3

v a
v a b a a v a.
a2

8. We want to show that AB C ij A BC ij for all 0 i n and 0 j q .


Starting with the left side, we have
p 1

AB C ij AB ik Ckj
k 0
p 1
m 1
Ail Blk C kj
k 0 l 0
m 1
p 1
Ail Blk C kj
l 0 k 0
m 1
Ail BC lj
l 0

A BC ij .

9. For a 2 2 matrix, its clear that the determinant is just the product of the two
diagonal entries. To prove the general case by induction, assume that for any
k n , the determinant of a k k matrix is equal to the product of its diagonal
entries. If we calculate the determinant of an n n matrix using expansion by
minors along the last column, then the only nonzero term corresponds to the
n 1, n 1 entry. This is multiplied by the determinant of the upper-left
n 1 n 1 portion of the matrix, which is known to be the product of its
diagonal entries. Since we are now simply multiplying by one more diagonal
entry, we have proven the general case.

10. In the product tA , every entry of A is multiplied by t. This means that every
factor in the Leibniz formula for the determinant is multiplied by t when A is
replaced by tA . Since every term has n factors, the full determinant is multi-
plied by a factor of t n .

a b
11. A matrix is singular when the determinant ad bc is zero, so we need
c d
to nd all cases for which ad bc with a, b, c, and d being either 0 or 1. Of
the 16 possible 2 2 matrices, the following 10 are singular.
4 Answers to Exercises

0 0 1 0 0 1 0 0 0 0
0 0 0 0 0 0 1 0 0 1

1 1 0 1 0 0 1 0 1 1
0 0 0 1 1 1 1 0 1 1

12. Multiply both sides of the equation LM I on the right by R. Then LMR R ,
but MR I , so L R.

13. The following matrix is the inverse of the elementary matrix E that multiplies
row r by t.

1 0
0


E 1 0 1 t 0 row r


0 0 1

The following matrix is the inverse of the elementary matrix E that exchanges
rows r and s. (In this case, E is its own inverse.)

1 0 0 0


0 0 1 0 row r

E
1

0 1 0 0 row s


0 0 0 1

The following matrix is the inverse of the elementary matrix E that adds row
s multiplied by the scalar value t to row r.
Answers to Exercises 5

column s

1 0 0 0


0 1 t 0 row r

E
1

0 0 1 0 row s


0 0 0 1

14. When the permutation is applied, the Leibniz formula becomes


n 1

det M
S n
sgn M k, k .
k 0
The sign of the permutation is 1 because it is a single transposition. Since
sgn sgn sgn , every term in the summation is negated.

15. Suppose that M is an n n matrix and that row r of M is all zeros. Let N be
any n n matrix. The r , r entry of the product MN is given by
n 1

MN rr M rk N kr ,
k 0

but each M rk 0, so its impossible to produce anything other than zero. Since
a one is needed in the r , r entry of the identity matrix, M cannot be invertible.

16. First, assume that M is invertible. Then I I T MM 1 T M 1 T M T , and


this shows that M 1 T is the inverse of M T . Second, assume that M T is in-
vertible. Then I T I M T 1 M T M M T 1 T T , and this shows that
M is the inverse of M. Since we know
T 1 T
that M 1 T is the inverse of
M from the rst part, and we know that M is the inverse of M T from
T T 1

the second part, it must be the case that M T 1 M 1 T.

17. The i, j entry of the product adj M M is given by


n 1

adj M M ij C ki M M kj .
k 0
6 Answers to Exercises

When i j, the summation is equal to the determinant of M. When i j , the


summation is equal to the determinant of M if it were modied so that the
entries in column j were replaced by the entries in column i. This matrix has
two identical columns and must therefore have a determinant of zero. Thus,
the entries on the main diagonal of adj M M are all det M , and all other
entries are zero. A similar argument can be applied to M adj M .

18. Multiplying the rst two matrices gives us

In 0 I n a b a I n a b a
T b T b T a b b T a 1 .
b 1 0 1
Now multiplying by the third matrix produces

In a b a In 0 I n a
T T ,
b b a b b a 1 b 1 0 1 a b
T T

where we have used the facts that ab T a b and b Ta a b . The determi-


nants of both sides of the original matrix identity are easily calculated because
each matrix contains a row or column that is all zeros except for the entry in
the lower-right corner. The determinant of the left side is the product of the
determinants of the three matrices, and the determinants of the rst and third
matrices are just one, so the determinant of the whole left side is simply the
determinant of the n n matrix I n a b . The determinant of the right side is
equal to 1 a b det I n . Therefore, det I n a b 1 a b.

19. The diagonal entries of M 1M are given by

b v yt a b t x
M 1M 00 s v t u
v a xt b a t y
M 1M 11 s v t u
d u ws c d s z
M 1M 22 s v t u
u c zs d c s w
M 1M 33 s v t u
A little regrouping in the numerators gives us
Answers to Exercises 7

b, v, a t ya xb
M 1M 00 s v t u
v, a, b t ya xb
M 1M 11 s v t u
d , u , c s wc z d
M 1M 22 s v t u
u , c , d s wc z d
M 1M 33 s v t u
.

The scalar triple products can each be permuted to give either a b c or


c d u , and then it is clear that the numerators and denominators are equal,
so the diagonal entries are all ones.

O the diagonal, we choose the 1, 0 entry, which is calculated as


v a xt a a t x
M 1M 10 s v t u
.

The term v a a is zero, and the remaining two terms in the numerator can-
cel, producing a zero for the 1, 0 entry.

20. The x component of the left side is

a y b z a z b y c x a z bx a x b z c y a xb y a y b x c z d x ,
and the x component of the right side is
a x d x a y d y a z d z b y c z bz c y bx d x b y d y bz d z c y a z c z a y
c x d x c y d y c z d z a y bz a zb y .

Collecting the terms on the right side containing the factor d x gives us

a x b y c z bz c y bx c y a z c z a y c x a ybz a z b y d x,
and each of these terms matches a term from the left side. We just need to show
that the remaining terms on the right side sum to zero. Those terms are
a y d y a z d z b y c z bz c y b y d y b z d z c y a z c z a y
c y d y c z d z a ybz a zb y ,
8 Answers to Exercises

and multiplying everything out produces


a y b y c z d y a yb z c y d y a z b y c z d z a z bz c y d z a z b y c y d y a y b y c z d y
a zbz c y d z a y bz c z d z a y b z c y d y a zb y c y d y a y bz c z d z a zb y c z d z .

Every term cancels, so the x components of both sides are equal.

Chapter 2
1. A matrix M is an involution if M 2 I. The determinant of M must therefore
square to one, which leaves only two possibilities, 1 or 1.

2. Since A and B for orthogonal, we know A 1 A T and B 1 B T. We then have

AB 1 B 1A 1 B T A T AB T .
Therefore, AB is orthogonal.

3. Let M be a symmetric matrix that is also an involution. Then M 2 I. Since M


is symmetric, M M T, so we can write MM T I , and this shows that M is
orthogonal. Now suppose that M is an orthogonal matrix that is also an invo-
lution. Since M is orthogonal, M 1 M T , and since M is an involution,
M 1 M. Thus, M T M, and this shows that M is symmetric.

1 a 2 0 0

4. N 0 1 b 2
0 .
0 0 1 c 2

1 s a x2 s 1 s a x a y 1 s a x a z

5. 1 s a x a y 1 s a y s 1 s a y a z .
2

1 s a x a z 1 s a y a z 1 s a z2 s

1 0 tan
6. (a) M skew , i, k 0 1 0 .
0 0 1
Answers to Exercises 9

1 0 0
(b) M skew , j, k 0 1 tan .

0 0 1

1 0 0
(c) M skew , j, i tan 1 0 .

0 0 1

7. The fourth row of HG is given by H 30G 0 H 31G 1 H 32G 2 H 33G 3, where


G i represents row i of G. Since H 30 H 31 H 32 0 and H 33 1, the fourth
row of the product HG is equal to the fourth row of G, which is 0 0 0 1 .

M M
8. .
0 1

9. Let q 1 v 1 s1 and q 2 v 2 s 2 . Then

v 1 v 2 s 1 v 2 s 2 v 1 s1 s 2 v 1 v 2 ,
2 2 2
q 1q 2

and this expands to

v 1 v 2 s12 v 22 s 22 v12 s12 s 22 v 1 v 2 .


2 2 2
q 1q 2

After applying Lagranges identity to the cross product and dot product, this
becomes

v12 v 22 s12 v 22 s 22 v12 s12 s 22 v12 s12 v 22 s 22 q 1


2 2 2
q 1q 2 q2 .

Taking square roots of both sides shows that the magnitude of the product is
equal to the product of the magnitudes.

q q q q
10. f q and g q .
2 2

11. The magnitude of q is given by


2 2

sin a 2 cos .
2
q
2 2
10 Answers to Exercises

We know that a 2 1, so we are left with the sum of a squared sine and squared
cosine of the same angle, which is always one.

12. The quaternions q i , q j, and q k perform 180-degree rotations about the


x, y, and z axes, respectively.

13. For the x axis, q 2


2
i 2
2
. For the y axis, q 2
2
j 2
2
. For the z axis,
q 22 k 22 .

14. Its required that c cos 2 . Applying the relationship cos v 1 v 2 and
the trigonometric identity cos 2 2 1 cos 2, we nd that

1 v1 v 2
c .
2
We must also have sa sin 2 v 1 v 2 sin . This can be simplied using
the identity sin 2 sin 2 cos 2 , and the quaternion can be written as
q 1 2c v 1 v 2 c.

Chapter 3
1. 3

2. The closest point is given by v , which corresponds to the parame-


v
ter t .
v2
3. The function f expands to f t 1 , t 2 2 t 2 v 2 1 t1 v 1 , and its partial
2

derivatives are
f
2 1 v 1 2 v 1 t1v12 t 2 v 1 v 2
t1
f
2 2 v 2 1 v 2 t 2 v 22 t1 v 1 v 2 .
t 2
Simultaneously setting these to zero (and dropping the factors of two) gives us
the system
v12 v 1 v 2 t1 2 1 v 1
.
v1 v 2 v 22 t 2 1 2 v 2
Answers to Exercises 11

When we negate the bottom row and solve for t1 and t 2, the result is equivalent
to Equation (3.24).

4. The line where the two planes n 1 | d 1 and n 2 | d 2 intersect is given by


n 1 n 2 | d 1n 2 d 2n 1 , and the homogeneous point closest to the origin on this
line is given by

vd n 1 2 d 2n 1 v 2 ,

where v n 1 n 2 . Distributing the cross product and dividing by the w coor-


dinate yields Equation (3.42).

5. n n and d d n t.

6. v v and m m t v .

7. By formula F in Table 3.1, the line v | m intersects the plane v | 0 at the


homogeneous point m v | v 2 , which is equivalent to v m | v 2 .

8. n v 1 v 2, and either d v 1 m 2 or d v 2 m 1.

9. n v 2 m 2 m 1 and d v, m 1 , m 2 .

v m 2 m1
10. d .
v2

11. v v t 2 0 v 0 v v v t
0 0 0 0 0 .

12. Set f v 2 u | u m 2 . This intersects the line v 1 | m 1 at the homogeneous


point p | w m 1 v 2 u u m 2 v 1 | v 2 u v 1 . The w coordinate
is equivalent to v 1 v 2 2 v12 v 22 . The vector triple product and the identity
given by Exercise 20 in Chapter 1 can be applied to produce the following
more symmetric formula for p:

p v 1 v 2 v 1 m 2 v 2 m 1 v12 v 2 m 2 v 22 v 1 m 1
m 2 v1 v1 v 2
12 Answers to Exercises

Chapter 4
1. The area of region A is a x b x b y a y , the area of region B is
2 x y
1
b b a y , and the area of region C is 12 a y a x b x . The total area of the
parallelogram spanned by a and b is A 2 B 2C , which simplies to the quan-
tity a x b y a y b x .

2. A B A B when n is even and gr A gr B is odd.

3. Suppose that A and B are both n 1 -blades. The set of basis vectors compos-
ing A and B can dier by at most one element because it would otherwise
require that we have more than n basis vectors. Therefore, we can write
A C v 1 and B C v 2, where C is an n 2 -blade representing the com-
mon factor between A and B, and v 1 and v 2 are vectors. The sum A B is then
C v 1 v 2 , and this is an n 1 -blade because v 1 v 2 is just a vector. Since
any n 1 -vector can be decomposed into a sum of n 1 -blades, this proves
that all n 1 -vectors must be n 1 -blades.

4. First assume that A is a 2-blade. Then A a b for some vectors a and b, and
clearly, A A a b a b 0.

Now assume that A A 0, and suppose that A is not a 2-blade. Then A can
be written as A a b B , where a and b are vectors, and B is a 2-vector such
that a b B 0. That is, the basis elements of a b are independent of the
basis elements of B, and the fact that the dimensionality is at least four guar-
antees that enough independent basis vectors are available. This means that
A A contains a nonzero term, which is a contradiction, so it must be the case
that A is a 2-blade.

5. Assume A B A B. Changing all right complements to left complements,


we have

A B 1
gr A gr B n gr A gr B
AB

and
gr A n gr A gr B n gr B
A B 1 A 1 B.
Answers to Exercises 13

The powers of 1 in the rst and second lines dier by 2 gr A gr B , which


has no eect because it is always even, so A B A B . The same proof ap-
plies to A B A B as well as the reverse implications.

6. We rst show that A B A B . Each component of A and B has the form


e i1 e i2 e ik . In each of the antiwedge products A B and A B, the only
nonzero products between components are those that have identical basis ele-
ments in A and B because for all other pairings, the complement of one would
exclude a basis vector that is also excluded by the other. For any basis element
C shared by A and B, we have C C 1 and C C 1, so A B and A B are
both equal to the same sum of the products of coecients of like components.

Now we only need to show that B A A B . By reversing the order of the


factors, we have
k nk
A B 1 B A.

Changing the right complement to left complement gives us


k nk
A B 1 1 k n k B A .
The total power of 1 is always even, so the equality holds.

7. By denition, A B C A B C . By the associativity of the antiwedge


product, A B C A B C. Then

A B C A B C A B C.
8. The dot product between L vx , Lvy , Lvz and L mx , L my , Lmz is
a wb x a x b w a y b z a z b y a w b y a y b w a z b x a x b z
a wb z a z b w a x b y a y b x .

When multiplied out, every term cancels, so the dot product is zero, and the
two vectors are therefore orthogonal.

9. Direct multiplication produces the following.


14 Answers to Exercises

q x p x e 41 q y p y e 42 q z p z e 43
p y q z p z q y e 23 p z q x p x q z e 31 p x q y p y q x e 12
q y rz p y rz p z ry q z ry p y q z p z q y e 234
p x rz q x rz q z rx p z rx p z q x p x q z e 314
q x ry p x ry p y rx q y rx p x q y p y q x e 124
p y q z rx p z q y rx p z q x ry p x q z ry p x q y rz p y q x rz e 123
p q q r r p e 4 p q r e4

10. e4 p w , L e 4 L vx e 1 Lvy e 2 L vz e 3, and f e 4 f x e 23 f y e 31 f z e 12.

1
11.
ab cdf g h
a b c f g h .

12. 1 v 2 14 1 2 v v v v v . Since v v 0 and v v 1 (because v


2

has unit length), the right side simplies to 1 v 2.

k k 1
13. f k .
2
14. Let p be the point closest to the origin on the line L. Then we can write m as
m p p v p v because p and p v are two points on the line. We
know that p and v are perpendicular, so p v 0, and we can write m pv using
the geometric product. Division by v gives us p m v.

15. Let A A 1 A 2 and B B1 B 2 . The product AB consists of terms


A i B j , where A i and B j have even grade and are thus composed of terms hav-
ing the form e i1 e i2 e ik , where k is even. When A i and B j are multiplied
together, the grade of the result is the sum of the grades of A i and B j less twice
the number of basis vectors that they have in common because one vector is
eliminated from A i, and one vector is eliminated from B j . The resulting grade
thus always remains even, and the subalgebra is closed.

16. The even subalgebra of the three-dimensional geometric algebra has the basis
elements 1, e 23 , e 31 , e 12 . The two-dimensional Cliord algebra has the
basis elements 1, e 1 , e 2 , e 12 . In the 3D case, let x e 23, y e 31, and
z e12. In the 2D case, let x e1, y e 2 , and z e 12 . Then in both cases, we
have x 2 y 2 z 2 1, xy z , yz x, and zx y. This is sucient to establish
an isomorphism.

Das könnte Ihnen auch gefallen