Mathematical Structures for Computer Graphics Exercise Answers

Mathematical Structures for Computer Graphics
Steven J. Janke
John Wiley & Sons, 2015
ISBN: 978-1-118-71219-1
Exercise Answers
Updated 3/17/15
Chapter 1
1. Four right-handed systems: (~i, ~j, ~k), (~i, −~j, −~k), (−~i, −~j, ~k), (−~i, ~j, −~k)
2. The diagonal divides each of the smaller squares into two triangles congruent to the original. The larger squares is divided by two diagonals
into four of the original triangles.
3. (Use similar triangles.)
√
4. Distance =
3
3
5. ∠ABC = 80.40◦ , ∠ACB = 48.99◦ , ∠BAC = 50.61◦
In radians: ∠ABC = 1.40, ∠ACB = 0.86, ∠BAC = 0.88
6. None are right triangles.
7. a.) Perpendicular bisector of P0 P1 .
b.) Center of circumscribed circle.
8. Square surrounding given square with rounded corners.
9. For example: (8,15,17) and (5, 12, 13)
10. (s2 − t2 )2 + (2st)2 = (s2 + t2 )
11. (2, 3) becomes ( 52 , 13
y−6
12. (x, y) becomes ( x+1
2 , 3
13. A is still in the upper semicircle in Fig. 1.10. 4CDB is still a right
triangle. ∠CDB still equals α.
1
14. The altitude goes from vertex A to side a dividing it into two parts:
c cos β and b cos γ. Also, α = π − (β + γ), so sin α = sin(β + γ). The
Law of Sines finishes the derivation.
Chapter 2
1. Midpoint = (110, 125)
2.
A = (80, 300)
P1 = (154, 252)
P2 = (228, 204)
P3 = (302, 156)
P4 = (376, 108)
B = (240, 60)
3.
~ = 8.60
|DE|
~ | = 4.47
|DF
∠EF D = 55.62◦
~ | = 10.30
|EF
∠EDF = 98.97◦
∠DEF = 25.41◦
4.
√
|~v | = |w|
~ = 2
√
~ 1 = ~v + w
D
~ = (1 + 2, 1)
√
~2 = w
D
~ − ~v = ( 2 − 1, −1)
~1 · D
~2 = 1 − 1 = 0
D
2
5.
~ = (10, 2)
|AB|
~ = (−1, 5)
|BC|
~ = (−10, −2)
|CD|
~ = (1, −5)
|DA|
~ · BC
~ = −10 + 10 = 0
AB
~ · CD
~ = 10 − 10 = 0
AB
~ · DA
~ = −10 + 10 = 0
CD
~ · AB
~ = 10 − 10 = 0
DA
6. Center = (7.5, 4.5)
7. P = Midpoint of BC = 21 B + 12 C and M = A + 32 (P − A)
8. ~v · (~r + ~s) = (v1 , v2 ) · (r1 + s1 , r2 + s2 ) = v1 (r1 + s1 ) + v2 (r2 + s2 ) = . . .
9. w
~=
29
54 (2, 7)
+
13
54 (8, 1)
10. |w|
~ = |~v | with diagonals (~v + w)
~ and (~v − w).
~ Finally, (~v + w)·(~
~ v − w)
~ = 0.
11. c2 = (x1 − x2 )2 + (y1 − y2 )2 + (z1 − z2 )2 = (x21 + y12 + z12 ) + (x22 + y22 +
z22 ) − 2|~u||w|
~ cos θ. Solve for the last term which is −2(~u · w).
~
12. cos θ = −0.348 =⇒ θ = 111.40◦ . (Note that this is a little small for
normal human vision.)
13.
~ | = 10.86
|ST
|T~U | = 7.81
∠T SU = 45.96◦
|U~S| = 7.68
∠ST U = 44.99◦
∠SU T = 89.04◦
14. Area = 3.464.
15.
A × B = (−16, −9, 10)
A × C = (17, −27, 4)
A × (B + C) = (1, −36, 14)
3
16. B × C is perpendicular to B and to C. A × (B × C) is perpendicular to
(B × C) and therefore must be in the plane described by B and C. The
x coordinate of A × (B × C) is a2 (b1 c2 − b2 c1 ) − a3 (B3 c1 − b1 c3 ) and this
equals the x coordinate of (A · C)B − (A · B)C. Similarly for the y and
z coordinates.
Chapter 3
1. P3 = (0.318, 1.67)
2. P = (8, − 32 ) + t(11, −3). Note direction vector could be (−11, 3).
3. Two possible answers: C = (33.84, 47.38) or C = (48.16, −31.38)
4. P = P0 + t~v where P0 = (−8, 12, 7) or P0 = (−2, −1, 3.5). Direction
vector ~v = (−6, 13, 3.5). Any vector parallel to ~v also works.
5. 13x − 11y + 21z = 78
6. Distance = 5.17
7. Distance = 9.82
8. (10, 12, −5)·(P −P0 ) where P0 = (19.51, 23.41, −9.76) or P0 = (−19.51, −23.41, 9.76).
9. All three planes contain A = (8, 3, 6) and have the form ~ni · (P − A)
where ~n1 = (2, −1, −1), ~n2 = (−8, −11, −5), ~n3 = (−1, 3, −5). Vectors
parallel to the ~ni will also work.
10. None of the pairs of line segments intersect.
11. The point (15, 16) is outside the triangle.
12. One possible algorithm: Test each of the two diagonals to find one such
that the line containing it separates the other two vertices (each is on a
different side of the line). If the quadrilateral is convex, both diagonals
will satisfy the condition. The midpoint of the selected diagonal is inside
the quadrilateral.
13. It intersects the plane at (−0.615, 3.538, 5.692).
4
14. Medians intersect at (5, 2.67, 4). Distances: 3.62 (to C), 3.28 (to B), 2.60
(to A).
15. Intersects in the two points (7.785, 0.595, 1.0) and (−3.585, −3.195, 1.0).
16. Closest point of intersection is (6.3, 9.3, 11.9).
17. New center: (9.039, 7.977, 11.994).
18. Q = (3.454, 0.636, 4.455)
19. Intersection: (1, 1, 3). This point is inside the triangle.
√
√
20. Volume of tetrahedron = 1/6 2; Volume of parallelopiped = 1/ 2;
Ratio = 1/6
21.
i. Angle between faces = 70.53◦
√
ii. Distance between edges AB and CD = 1/ 2
√ √
iii. Length of altitude = 2/ 3
iv. Angle between AB and face ACD = 54.74◦
22. Line = (6, 2, −34); Point of intersection = (51, −11, 26)
23. (a.) Normal to plane (Cartesian) = (4, −7, 2). (b.) Point of intersection
(Cartesian) of three planes = (−1.072, 1.471, 0.045)
24. Line of intersection: P = (8, 4, 0) + t(7, 9, 4)
25. Intersection point = (0.255, −0.346, 4.085)
26. Distance between lines = 1.303. Distance between segments = 5.163.
27. Angle with plane = 63.24◦ .
28. Line: P = (51.99, −8.27, 0) + t(15, −7, −1)
29. Triangle area = 155.
30. Vector = (−1, 20, 46) (or any multiple).
31.
i. Multiplication/Division = 11; Addition/Subtraction = 13; Square
roots = 3
5
ii. Multiplication/Division = 22; Addition/Subtraction = 22; Square
roots = 0
32. Q1 = (3.722, −1.166, −8.278) and Q2 = (10.06, 2.0, −5.112)
33. Not coplanar.
34. 4 · 2 + 11 · 5 − 4 · 1 = 59 > 13 and 4 · 6 + 11 · (−2) − 4 · 3 = −10 < 13.
Therefore, they are on opposite sides of the line. Same idea in three
dimensions.
Chapter 4
5/8 −1/8
1.
3/2 1/2
2. A∗ = (−2, −3), B ∗ = (5.07, −4.14), C ∗ = (6.49, −0.17)
3. C = (37.54, 27.05) or C = (44.46, −11.05)
x 1 y1
. Then the area
4. If B = (x1 , y1 ) and C = (x2 , y2 ), let P =
x 2 y2
of 4ABC is one half the determinant, 21 det P . (This follows from the
~ − A)
~ × (C
~ − A.)
~ In general, if matrix M transforms
cross product (B
the triangle, the area is 21 det M P = 12 det M det P = 21 det P .
5. (3.71, 7.37)
6. (5.67, 0.67, 3.67)
1 0
1/2 1/2
7. Project onto x-axis:
. Project onto y = x:
.
0 0
1/2 1/2
−0.8 0.6
−4.2
8. T (P ) =
P+
0.6 0.8
1.4
9. The product of two rotation matrices has entries of the form cos(θ + γ)
and ± sin(θ + γ). The product of two reflection matrices has ±1 on the
main diagonals and zeroes elsewhere.
6

−1 0 0
 0 −1 0
10. 
 0 0 −1
0 0 0

e f
11. Marb =  g e
f g

4
10 

−2
1

g
f  where e =
e
√
1+ 3
3 ,
f=
√
1− 3
3 ,
g = 13 .
(0, 0, 0) →(0, 0, 0)
(0, 0, 1) →(0.33, −0.24, 0.91)
(0, 1, 0) →(−0.24, 0.91, 0.33)
(0, 1, 1) →(0.09, 0.67, 1.24)
(1, 0, 0) →(0.91, 0.33, −0.24)
(1, 0, 1) →(1.24, 0.09, 0.67)
(1, 1, 0) →(0.67, 1.24, 0.09)
(1, 1, 1) →(1, 1, 1)


 

0 1 0
1 0 0
0 1 0
12. Marb = 0 0 1 = 0 0 1 −1 0 0. The product on the right
0 0 1
0 −1 0
1 0 0
represents a clockwise (π/2) rotation around the z-axis followed by a
clockwise (π/2) rotation around the x-axis.
13. Both tetrahedrons are centered at (0, 0, 0)
√ so no translation is needed.
The larger needs to be scaled down by 1/ 8. Transforming the tetrahedron from the exercise to the one from the example gives the following
matrix:


−0.29 −0.14 0.14
M = −0.20 0.20 −0.20
0
0.25 0.25
14. Both sides of the equation are vectors, so we need to show their coordinates match. The x coordinate of A × (B × C) is
ay (bx cy − by cx ) − az (bz cx − bx cz )
7
On the right side, the x coordinate is
ax cx + ay cy + az cz )bx − (ax bx + ay by + az bz )cx
Algebraically they are equal and the same approach shows the y and z
coordinates are equal.
15. If Rcw is the clockwise rotation that moves the line to the x-axis, then
1
0
1
0
−0.28
−0.96
−1
· Rcw ·
=
T = Rcw
·
0 −1
0 −1
0.96 −0.28
The matrix corresponds to a counter-clockwise rotation of 106.26◦ .
16. Each cross section where y = y0 becomes a parallelogram with area
one. The height (y direction) of the cube does not change since all y
coordinates remain the same. Hence the transformed cube has volume
one.
17. Projected segment has end points (3.08, −1.54) and (2.5, 5).
18. Projected segment has end points (4, −2, −6) and (5, 10, −20).
19. Assuming the eye is on the z axis and the two segments are parallel to
each other, if they are also parallel to the xy plane, they will project to
parallel lines.
1 2
20.
0 1
21. ~a × w
~ ⊥ = ~a × (w
~ − (~a · w)~
~ a) = ~a × w
~ − (~a · w)(~
~ a × ~a) = ~a × w
~
22. The transformed cube is similar to that in exercise #16; only the orientation of the parallelogram cross-sections has changed. Volume is still
one.
8