Sie sind auf Seite 1von 7

CSE385: Homework #1

Answers April 20, 2003


For the purposes of this homework, you should assume that we are using a right-handed coordinate system. 1. Let a vector v = [5 3 7]. (a) Compute v , the vector length of v. Answer: v = 52 + 32 + 72 =

83.

(b) Compute the angle v which makes with the x-axis [1 0 0]. Express your answer in radians. Answer: vx 5 cos = = v 83 5 = cos1 0.98984277. 83 (c) Show that the vector u = [1 4 1] is orthogonal to v. Answer: v u = 5 1 + 3 4 + 7 1 = 5 12 + 7 = 0 Therefore, u is orthorogonal to v. 2. Let p1 , p2 , p3 , and p4 R3 be four points in 3D Euclidean space. They make two triangles t1 (p1 , p2 , p3 ), and t2 (p3 , p2 , p4 ). (a) Give an expression for the normal vector n of the triangle t1 involving p1 = (x1 , y1 , z1 ), p2 = (x2 , y2 , z2 ), and p3 = (x3 , y3 , z3 ). Answer: n = (p2 p1 ) (p3 p1 ) = (x2 x1 , y2 y1 , z2 z1 ) (x3 x1 , y3 y1 , z3 z1 ) = ((y2 y1 )(z3 z1 ) (y3 y1 )(z2 z1 ), (x3 x1 )(z2 z1 ) (x2 x1 )(z3 z1 ), (x2 x1 )(y3 y1 ) (x3 x1 )(y2 y1 )). 1

(b) Give an expression for the dihedral angle between two triangles t1 and t2 involving p1 , p2 , p3 , and p4 . (Dihedral angle is the angle between two planes.) Answer: Let the unit normal vectors n1 and n2 of triangles t1 and t2 be n1 n2 Therefore, = cos1 n1 n2 (p2 p1 ) (p3 p1 ) (p2 p3 ) (p4 p3 ) . = cos1 (p2 p1 ) (p3 p1 ) (p2 p3 ) (p4 p3 ) = = (p2 p1 ) (p3 p1 ) (p2 p1 ) (p3 p1 ) (p2 p3 ) (p4 p3 ) . (p2 p3 ) (p4 p3 ) and

3. Consider the three vectors: [1 0 0], [1 1 0], and [1 1 1] R3 . Show that they are linearly independent. Derive an orthonormal basis from these vectors, starting with [1 0 0]. Answer: Let three vectors be v1 = [1 0 0], v2 = [1 1 0], and v3 = [1 1 1]. If v1 + v2 + v3 = 0 has only solution = = = 0, three vectors are linearly independent. v1 + v2 + v3 ++ + == = = = = = [1 0 0] + [1 1 0] + [1 0 0] = 0 0 0 0 0

Therefore, three vectors are linear independent. We can convert an arbitrary basis into an orthogonal basis by the Gram-Schmidt process. Let a new basis be {u1 , u2 , u3 }. u1 u2 = = = u3 = = v1 = [1 0 0] v2 u1 v2 u1 u1 2 1 [1 1 0] 2 [1 0 0] = [0 1 0] 1 v3 u1 v3 u2 v3 u1 u2 u1 2 u2 2 1 1 [1 1 1] 2 [1 0 0] 2 [0 1 0] = [0 0 1] 1 1

Therefore, a new orthonoraml basis {[1 0 0], [0 1 0], [0 0 1]}, because u1 = u2 = u3 = 1. 4. Show that the multiplication and division of two complex numbers z1 = r1 (cos 1 + i sin 1 ) and z2 = r2 (cos 2 + i sin ) are z1 z2 = r1 r2 (cos(1 + 2 ) + i sin(1 + 2 )) and z1 /z2 = r1 /r2 (cos(1 2 ) + i sin(1 2 )). Answer: z1 z2 = = r1 r2 (cos 1 + i sin 1 )(cos 2 + i sin 2 ) r1 r2 (cos 1 cos 2 + i sin 1 cos 2 + i sin 2 cos 1 sin 1 sin 2 )

By the trigonometric addition formulas, cos 1 cos 2 sin 1 sin 2 sin 1 cos 2 + cos 1 sin 2 Therefore, z1 z2 = r1 r2 (cos(1 + 2 ) + i sin(1 + 2 )). r1 (cos 1 + i sin 1 ) r2 (cos 2 + i sin 2 ) r1 (cos 1 + i sin 1 )(cos 2 i sin 2 ) r2 (cos 2 + i sin 2 )(cos 2 i sin 2 ) r1 (cos 1 cos 2 + i sin 1 cos 2 i sin 2 cos 1 + sin 1 sin 2 ) r2 (cos2 2 + sin2 2 ) = = cos(1 + 2 ), sin(1 + 2 ). and

z1 /z2

= = =

By the trigonometry(cos2 2 + sin2 2 = 1) and trigonometric addition formulas, cos 1 cos 2 + sin 1 sin 2 sin 1 cos 2 cos 1 sin 2 Therefore, z1 /z2 = r1 /r2 (cos(1 2 ) + i sin(1 2 )). 5. Show that the multiplication of two quaternions q1 = (s1 , v1 ) and q2 = (s2 , v2 ) is q1 q2 = (s1 s2 v1 v2 , s1 v2 + s2 v1 + v1 v2 ). Answer: Let v1 and v2 be (a1 , b1 , c1 ) and (a2 , b2 , c2 ). q1 q2 = (s1 , v1 ) = s1 + ia1 + jb1 + kc1 = (s2 , v2 ) = s2 + ia2 + jb2 + kc2 . 3 and = = cos(1 2 ), sin(1 2 ). and

q1 q2

= = =

(s1 + ia1 + jb1 + kc1 )(s2 + ia2 + jb2 + kc2 ) s1 s2 + s1 (ia2 + jb2 + kc2 ) + s2 (ia1 + jb1 + kc1 ) +(ia1 + jb1 + kc1 )(ia2 + jb2 + kc2 ) s1 s2 + s1 (ia2 + jb2 + kc2 ) + s2 (ia1 + jb1 + kc1 ) +i2 a1 a2 + ija1 b2 + ika1 c2 + jia2 b1 + j 2 b1 b2 + jkb1 c2 +kia2 c1 + kjb2 c1 + k 2 c1 c2

By the fundamental formula of quaternion algebra, i2 = j 2 = k 2 = ijk ij = ji jk = kj ki = ik Therefore, q1 q2 = = s1 s2 + s1 (ia2 + jb2 + kc2 ) + s2 (ia1 + jb1 + kc1 ) a1 a2 + ka1 b2 ja1 c2 ka2 b1 b1 b2 + ib1 c2 + ja2 c1 ib2 c1 c1 c2 s1 s2 a1 a2 b1 b2 c1 c2 + s1 (ia2 + jb2 + kc2 ) + s2 (ia1 + jb1 + kc1 ) +i(b1 c2 b2 c1 ) + j(a2 c1 a1 c2 ) + k(a1 b2 a2 b1 ). = = = = 1 k i j.

That equation can be rewritten by the dot product(v1 v2 = a1 a2 + b1 b2 + c1 c2 ) and the vector product(v1 v2 = (b1 c2 b2 c1 , a2 c1 a1 c2 , a1 b2 a2 b1 )). Therefore, q1 q2 = (s1 s2 v1 v2 , s1 v2 + s2 v1 + v1 v2 ).

Figure 1: A circle and an ellipse.

6. An ellipsoid with center at the coordinate origin couble be dened in an implicit expression as x2 y2 z2 + 2 + 2 = 1. a2 b c Give its parametric form with parameter u, v (0 u, v 1). Answer: In case of a circle x2 + y 2 = r2 (Figure 1), its parametric equation is x = r cos and y = r sin . With a parameter u (0 u 1), its parmaetric form can be rewritten as x(u) = r cos(2u) and y(u) = r sin(2u). Similarly, an ellipse
x2 a2

y2 b2

= 1 has a parametric equation as and y = b sin .

x = a cos

Also we can rewrite its parametric form with a parameter u (0 u 1) as x(u) = a cos(2u) and y(u) = b sin(2u). In 3 dimensional, the parameteric form of a sphere is x(u, v) = y(u, v) = z(u, v) = r cos(2u) sin(v), r sin(2u) sin(v), r cos(v). and

Likewise, an ellipsoid has a parametric form as x(u, v) = y(u, v) = z(u, v) = a cos(2u) sin(v), b sin(2u) sin(v), c cos(v). and

Cf. All derivation and proof are omitted. 7. Fill in the blanks. Answer: First of all, lets look into the angular displacement. We can calculate a vector Rp when a vector p is rotated by the angle with the axis n (Figure 2). n p = (p n)n = pn = p (p n)n (1) (2)

A vector p is orthogonal to vectors n and p at the same time. p = n p = n p 5 (3)

Figure 2: 3D Rotation of a vector p by the angle with the axis n. A vector p will become Rp = Rp n after it is rotated. Rp = cos p + sin p Therefore, we can derive Rp as followings: Rp = = = = n + Rp (p n)n + cos p + sin p (p n)n + cos (p (p n)n) + sin (n p) cos p + (1 cos )(p n)n + sin (n p) (4)

(5)

Equation (5) is the angular displacement, which is the formula for rotating a vector p by angle with the axis n. Now let an unit quaternion q = (s, v). Because q is an unit quaternion, |q|2 = q q = s2 + v2 = 1. Since cos2 + sin2 = 1, we can express q = (cos , sin ), where n is an unit vector (| | = 1). As we n n studied in last class, Rp = qp, where p is a quaternion p = (0, p). q qp = (s, v)(0, p)(s, v) q = (v p, sp + v p)(s, v) = (sv p + (sp + v p) v, (v p)v + s(sp + v p) (sp + v p) v) For real part, sv p + (sp + v p) v = = = becuase v p is orthogonal to v. For imaginary part, (v p)v + s(sp + v p) (sp + v p) v 6 sv p + sp v + (v p) v (v p) v 0,

(6)

= = = = =

(v p)v + s2 p + s(v p) s(p v) (v p) v (v p)v + s2 p + s(v p) + s(v p) (v p) v (v p)v + s2 p + 2s(v p) (v p) v (v p)v + s2 p + 2s(v p) (v v)p + (p v)v (s2 v v)p + 2(v p)v + 2s(v p).

Cf. relationship between cross and dot products u (v w) = (u w)v (u v)w (u v) w = (u w)v (v w)u Therefore, qp = (0, (s2 v v)p + 2(v p)v + 2s(v p)). q Now we substitue s = cos and v = sin . n qp = (0, (cos 2 sin2 | |2 )p + 2(sin p) sin + 2 cos (sin p)) q n n n n 2 2 2 = (0, (cos sin )p + 2 sin ( p) + 2 cos sin ( p)) n n n = (0, cos 2p + (1 cos 2)( p) + sin 2( p)) n n n (8) Compared with Equation (5), the imaginary part of Equation (8) shows the result of rotating p by angle 2 about the axis n. (7)

Das könnte Ihnen auch gefallen