The 3D cross product (aka 3D outer
product or vector product) of two vectors
a and b is only defined on three
dimensional vectors as another vector a×b that is
orthogonal to the plane containing both a and b and has a
magnitude of
∣a×b∣=∣a∣∣b∣sinθ
where θ is the angle
between a and b. The length of the cross
product equals the area of the parallelogram bordered by the two
vectors. Also note that sinθ is always positive, since the angle will never exceed 180°.
Note that if a and
b have a length of one,
the length of the cross product is only one when θ=90∘, as
sinθ=1.
Another definition of the cross-product keeps the direction of the
cross product in a unit vector n^ perpendicular to a
and
b such that:
a×b=n^∣a∣∣b∣sinθ
From which is also obvious that collinear (parallel) vectors a and
b result in sinθ=0 and thus a×b=0
To derive the cross product c=a×b. From the definition that c is orthogonal
to both,
a and b, we know that
a⋅c=axcx+aycy+azcz=0
b⋅c=bxcx+bycy+bzcz=0
To eliminate cz we multiply the
first equation by bz and the
second by az and subtract:
(axbz−azbx)cx+(aybz−azby)cy=0
This equation has the form pcx+qcy=0, for which an obvious
solution is cx=q and cy=−p. Thus
cx=aybz−azbycy=azbx−axbz
and by substituting in the original equations:
cz=axby−aybx
Alternatively, we can derive the cross product using the determinant, similar to the calculation of the 2D perp-product or perp-roduct using the determinant
with x^,y^ and z^ being the
orthonormal basis.:
There are two possible choices to compute the cross product, each the
negation of the other. This makes the cross product not commutative and
thus anticommutative / antisymmetric. The one chosen is determined by
the right-hand rule. If your index finger is a, your middle finger
b then your thumb is the
positive cross product a×b.
a×b=−(b×a)=(−b)×a
Additive Distribution
a×(b+c)=a×b+a×c
(a+b)×c=a×c+b×c
Großmann Identity or
Double vector product
Left Association
(a×b)×c=(a⋅c)b−(b⋅c)a
Right Association
a×(b×c)=(a⋅c)b−(a⋅b)c
Lie Identity
a×(b×c)+c×(a×b)+b×(c×a)=0
Dot-Cross Association
a⋅(b×c)=(a×b)⋅c
Scalar Association
(αa)⋅(βb)=(αβ)(a×b)
α(a×b)=(αa)×b=a×(αb)
Normality
(a×b)⋅a=(a×b)⋅b=0
Nilpotent
a×a=0
a×0=0×a=0
Jacobi Identity
a×(b×c)+b×(c×a)+c×(a×b)=0
Cyclic Permutations
The following cyclic permutations of cross products for the vectors a, b and c
hold:
a×b=b×c=c×a
a×b+b×c+c×a=0
Lagrange Identity
(a×b)⋅(c×d)=(a⋅c)(b⋅d)−(a⋅d)(b⋅c)
From which follows that the square of the norm is
∣a×b∣2=∣a∣2∣b∣2−(a⋅b)2
which is a nice connection between the dot-product and the cross
product. Especially with normalized vectors this is
=sin2θ∣a^×b^∣2=1−=cos2θ(a^⋅b^)2
But we can go further with the square of the norm:
From which follows the definition of the cross product:
∣a×b∣=∣a∣∣b∣sinθ
Which works since the angle between a and b is always between 0°
and 180°
and therefore sinθ≥0.
Scalar Triple Product
The dot-cross product a⋅(b×c) has the name scalar triple
product and is denoted by [a,b,c]. It computes the (signed)
volume of the parallelepiped
spanned by the vectors a, b and c:
[a,b,c]=det(abc)=a⋅(b×c)=b⋅(c×a)=c⋅(a×b)
The sign is positive if a, b and c form a right handed set and negative if
they form a left handed set.
Vector Triple Product
The vector triple product is
a×(b×c)
Applications
Normal to a triangle
The most common application of the cross product is to generate a
vector orthogonal to two other vectors. Suppose we have three points
P, Q and R and want to generate a unit vector
n^ that is orthogonal
to the plane formed by the three points.
Now a=Q−P and b=R−P and the normal can be
found with n=a×b.
The direction of the normal is usually chosen to point from the inside
to the outside of our object.
Interestingly, the length ∣n∣ here equals twice the area
of the triangle (since halve of the parallelogram formed by a and
b is our triangle).
Equation of a plane given three points
Given three points P1, P2, P3, we can form two vectors v1=P1P2 and
v2=P1P3 that lie in that plane. Now let P=(x,y,z)T be a general point in space. P
lies in the plane iff the vector v3=P1P lies in that plane, which is the case if and only
if the volume of the parallelepiped spanned by v1,v2,v3 is zero and
therefore the Scalar Triple Product:
[v1,v2,v3]=0
This is enough to solve for the plane equation. Another method fixes a point, i.e. P1, in the plane and
requiring that every vector in the plane will tail P1 and is normal to n. Therefore
n=v1×v2
is one normal to the plane. Now P is in the plane if and only if v3 is orthogonal to
n.
v3⋅n=0
From there the typical plane equation can be read off, which has the form
(x−P1,x)nx+(y−P1,y)ny+(z−P1,z)nz=0
Distance between two lines
Consider two lines in space ℓ1 and ℓ2 such that point
ℓ1 passes through P1 and is parallel to vector
v1
and ℓ2 passes through P2 and is parallel to
v2. We
want to compute the
smallest distance d between the two
lines.
If the lines intersect, the distance is d=0.
If they are parallel, then d
corresponds to the distance between point P2 and ℓ1:
d=∥v1∥∥P1P2×v1∥
If the lines are not paralll and do not intersect (skew lines) then
let n=v1×v2
be a vector perpendicular to both lines. The projection of vector onto
n gives d:
d=∥n∥∣P1P2⋅n∣
Test if two vectors are
parallel
Like the dot product, the cross product can be used to determine if
two vectors a and b are parallel, which is the
case when a×b=0.
This result comes directly from the definition of the length of the
cross product, since sin(θ)=0
for 0° and 180°. Calculating ∣a×b∣=0 or simply
(a×b)⋅(a×b)=0
has the advantage of using less operations with nonnormalized vectors
over the parallel-test using the dot-product.