Section 31-03.mws

Unit 6: Matrix Algebra

Chapter 31: Vectors as Arrows

Section 31.3: the cross product

Copyright

Copyright * 2001 by Addison Wesley Longman, Inc.

All rights reserved. No part of this publication may be reproduced, stored in a retrieval system, or transmitted, in any form or by any means, electronic, mechanical, photocopying, recording, or otherwise, without the prior written permission of the publisher. Printed in the United States of America.

Initializations

> restart;

> with(linalg):
with(plots):
with(plottools):
read(`C:/Program Files/Maple 6.01/pvac.txt`):

Warning, the protected names norm and trace have been redefined and unprotected

Warning, the name changecoords has been redefined

>

Derivation of Formula (12.5) for the Cross Product

Formula (12.5) in Section 12.4 can be derived from the three properties that A x B , the cross product of the vectors A and B , is orthogonal to both A and B , forms a right-handed system with A and B , and has length given by

|| A x B || = || A || || B || sin theta

where theta in [0, Pi] is the angle between A and B . To do this, let the vectors A , B , and C be given respectively by

> A := vector([seq(a[k],k=1..3)]):
B := vector([seq(b[k],k=1..3)]):
C := vector([seq(c[k],k=1..3)]):
print(A,B,C);

MATRIX([[a[1]], [a[2]], [a[3]]]), MATRIX([[b[1]], [...

>

The condition that C be perpendicular to both A and B yields the two equations

> q1 := dotprod(A,C,orthogonal) = 0;
q2 := dotprod(B,C,orthogonal) = 0;

q1 := a[1]*c[1]+a[2]*c[2]+a[3]*c[3] = 0

q2 := b[1]*c[1]+b[2]*c[2]+b[3]*c[3] = 0

>

Then,

|| A x B || = || A || || B || sin theta

yields the third equation

sqrt(c[1]^2+c[2]^2+c[3]^2) = sqrt(a[1]^2+a[2]^2+a[3...

which we obtain in Maple with

> normA := simplify(norm(A,2),symbolic);
normB := simplify(norm(B,2),symbolic);
normC := simplify(norm(C,2),symbolic);

normA := sqrt(a[1]^2+a[2]^2+a[3]^2)

normB := sqrt(b[1]^2+b[2]^2+b[3]^2)

normC := sqrt(c[1]^2+c[2]^2+c[3]^2)

> q3 := normC = normA*normB*sin(angle(A,B));

q3 := sqrt(c[1]^2+c[2]^2+c[3]^2) = sqrt(a[1]^2+a[2]...

>

Solving these three equations for c[1], c[2], c[3] gives

> q4 := solve({q||(1..3)},{c[1],c[2],c[3]});

q4 := {c[3] = b[1]*a[2]-b[2]*a[1], c[2] = -b[1]*a[3...

>

There are two solutions, namely,

> C1 := subs(q4[1],op(C));
C2 := subs(q4[2],op(C));

C1 := MATRIX([[-a[2]*b[3]+a[3]*b[2]], [-b[1]*a[3]+b...

C2 := MATRIX([[a[2]*b[3]-a[3]*b[2]], [b[1]*a[3]-b[3...

>

that is,

MATRIX([[a[2]*b[3]-a[3]*b[2]], [a[3]*b[1]-a[1]*b[3]... and -MATRIX([[a[2]*b[3]-a[3]*b[2]], [a[3]*b[1]-a[1]*b[3...

A simple test with the unit vectors { i , j , k } shows the first solution obeys the right-hand rule and points in the appropriate direction. The other solution is its negative. Consequently, orthogonality, the length condition, and the right-hand rule determine the cross product which we write more compactly as

A x B = det*MATRIX([[i, j, k], [a[1], a[2], a[3]], [b[1], b...

in terms of the determinant of a 3 x 3 matrix. (See Section 12.4 for a discussion of determinants.)

In Maple, we could perform this test via

> subs(a[1]=1,a[2]=0,a[3]=0, b[1]=0,b[2]=1,b[3]=0, op(C1));
subs(a[1]=1,a[2]=0,a[3]=0, b[1]=0,b[2]=1,b[3]=0, op(C2));

MATRIX([[0], [0], [-1]])

MATRIX([[0], [0], [1]])

>

The first vector is consistent with the right-handed i x j = k .

Alternatively, comparing to Maple's built-in crossprod command,

> crossprod(A,B);

MATRIX([[a[2]*b[3]-a[3]*b[2]], [b[1]*a[3]-b[3]*a[1]...

>

is another way we might select the correct solution from the two solutions found.

>

Example 31.6

If

A = 2 i ``-`` 2 j ``-`` k

and

B = i + j + k

that is, if

> A := vector([2, -2, -1]);
B := vector([1, 1, 1]);

A := MATRIX([[2], [-2], [-1]])

B := MATRIX([[1], [1], [1]])

>

then

A x B = det MATRIX([[i, j, k], [2, -1, -1], [1, 1, 1]]) = MATRI...

that is,

> AxB := crossprod(A, B);

AxB := MATRIX([[-1], [-3], [4]])

>

with A , B , and A x B shown in FIgure 31.10.

> p1 := arrow([0,0,0], A, [1,1,1], .1,.3,.2, color=black):
p2 := arrow([0,0,0], B, [1,0,1], .1,.3,.2, color=black):
p3 := arrow([0,0,0], AxB, [2,1,1], .1,.3,.2, color=black):
p4 := textplot3d({[1,-1.5,-.7,`A`], [.5,.7,.9,`B`], [-.5,-1,2.1,`AxB`]}, color = black, font=[TIMES,ROMAN,14]):
p5 := spacecurve({[[0,0,0],[2,0,0],[2,-3,0],[0,-3,0],[0,0,0]], [[0,0,0],[0,0,4]]}, color=black, linestyle=2):
display([p||(1..5)], orientation=[-30,75], axes=boxed, scaling=constrained, labels=[`x `,` y`,`z `], labelfont=[TIMES,ITALIC,12], tickmarks=[4,4,5]);

[Maple Plot]

>

Additional Properties of the Cross Product

A compendium of formulas for the cross product is listed in Table 31.3, the contents of which are the following.

1. Scalar Multiplication ( a A ) x ( b B ) = ab ( A x B )

2. Distributive Laws A x ( B + C ) = A x B + A x C

( B + C ) x A = B x A + C x A

3. Anti-Commutation B x A = ``-`` A x B

4. Non-Associative A x ( B x C ) = ( A . C ) B ``-`` ( A . B ) C

( A x B ) x C = ( A . C ) B ``-`` ( B . C ) A

_______________________________________________________________

Table 31.3

The first two laws suggest the cross product obeys some of the rules of ordinary algebra. However, the failure of the commutative law (3) and of the associative laws (4) points out the singular nature of the cross product.

>

Additional Examples (Not in Text)

The non-associativity of the cross product illustrated in the following computation involving the vectors

> A := vector([seq(a[k], k = 1..3)]):
B := vector([seq(b[k], k = 1..3)]):
C := vector([seq(c[k], k = 1..3)]):
print(A,B,C);

MATRIX([[a[1]], [a[2]], [a[3]]]), MATRIX([[b[1]], [...

>

Computing A x ( B x C ) and ( A x B ) x C , we find

> q1 := crossprod(A, crossprod(B,C));
q2 := crossprod(crossprod(A,B), C);

q1 := MATRIX([[a[2]*(b[1]*c[2]-b[2]*c[1])-a[3]*(b[3...

q2 := MATRIX([[(b[1]*a[3]-b[3]*a[1])*c[3]-(-b[1]*a[...

>

That these are not equal is established by

> map(simplify,evalm(q1-q2));

MATRIX([[-a[2]*b[2]*c[1]-a[3]*b[3]*c[1]+c[3]*b[3]*a...

>

If A x ( B x C ) = ( A x B ) x C , then the difference just computed would have been the zero vector.

On the other hand, compare A x ( B x C ) with A x ( B x C ) = ( A . C ) B ``-`` ( A . B ) C , that is, with

> Q1 := evalm(dotprod(A,C,orthogonal)*B - dotprod(A,B,orthogonal)*C);

Q1 := MATRIX([[(a[1]*c[1]+a[2]*c[2]+a[3]*c[3])*b[1]...

>

via the subtraction

> map(simplify,evalm(q1-Q1));

MATRIX([[0], [0], [0]])

>

and compare ( A x B ) x C with ( A x B ) x C = ( A . C ) B ``-`` ( B . C ) A , that is, with

> Q2 := evalm(dotprod(A,C,orthogonal)*B - dotprod(B,C,orthogonal)*A);

Q2 := MATRIX([[(a[1]*c[1]+a[2]*c[2]+a[3]*c[3])*b[1]...

>

via the subtraction

> map(simplify,evalm(q2-Q2));

MATRIX([[0], [0], [0]])

>