The Cross Product

Cross Product

Load the module Barry wrote to show a vector:

plotvector3D[{x_,y_,z_},color_]:=Module[{line,head,headsize},
headsize=0.015*(Sqrt[(x^2)+(y^2)+(z^2)]);
head=Sphere[{x,y,z},headsize];
line=Line[{{0,0,0},{x,y,z}}];
Return[Graphics3D[{color,Thick,line,head}]];
]

Mathematica has a built-in command to evaluate a cross product of two vectors, called Cross:

u={1,0,0}
v={0,1,0}
cross=Cross[u,v]

Notice that the cross product vector is orthogonal to the two vectors it came from:

Show[plotvector3D[u,Blue],plotvector3D[v,Blue],plotvector3D[cross,Red],Axes->True,AxesLabel->{"x","y","z"}]

Here is another example, that shows the cross product has a length that is the area of the parallelogram created by the vectors that created it:

u={2,1,1}
v={-4,3,1}
cross=Cross[u,v]

Show[plotvector3D[u,Blue],plotvector3D[v,Blue],plotvector3D[cross,Red],Axes->True,AxesLabel->{"x","y","z"}]

The length of the cross product is:

(Sqrt[((cross[[1]])^2)+((cross[[2]])^2)+((cross[[3]])^2)])

The area of the parallelogram created by the two vectors that created the cross product is:

θ=ArcCos[((u.v)/((Sqrt[((u[[1]])^2)+((u[[2]])^2)+((u[[3]])^2)])(Sqrt[((v[[1]])^2)+((v[[2]])^2)+((v[[3]])^2)])))]
(Sqrt[((u[[1]])^2)+((u[[2]])^2)+((u[[3]])^2)])(Sqrt[((v[[1]])^2)+((v[[2]])^2)+((v[[3]])^2)])Sin[θ]

Triple Scalar product

The scalar triple product is a scalar quantity, and is easiest to calculate using a determinant:

u={1,2,1}
v={-2,3,4}
w={3,2,1}
triplescalar=Cross[u,v].w

MatrixForm[{u,v,w}]
Det[{u,v,w}]

The following shows the scalar triple product for different vectors (one vector is allowed to change). Can you make the scalar triple product zero? What do you notice about the vectors when that happens? You will want to rotate the image!

Manipulate[
Show[
Graphics3D[Text["Scalar Triple Product"Det[{{u1,u2,u3},v,w}],{4,4,4}]],
plotvector3D[{u1,u2,u3},Blue],
plotvector3D[v,Green],
plotvector3D[w,Red],
Axes->True,AxesLabel->{"x","y","z"},PlotRange->{{-5,5},{-5,5},{-5,5}}],{u1,-3,3},{u2,-3,3},{u3,-3,3}]