Contents
raw book

The 3D cross product (aka 3D outer product or vector product) of two vectors a\mathbf{a} and b\mathbf{b} is only defined on three dimensional vectors as another vector a×b\mathbf{a}\times\mathbf{b} that is orthogonal to the plane containing both a\mathbf{a} and b\mathbf{b} and has a magnitude of

a×b=absinθ|\mathbf{a}\times\mathbf{b}|=|\mathbf{a}| |\mathbf{b}| \sin\theta

where θ\theta is the angle between a\mathbf{a} and b\mathbf{b}. The length of the cross product equals the area of the parallelogram bordered by the two vectors. Also note that sinθ\sin\theta is always positive, since the angle will never exceed 180°.

a\mathbf{a}
b\mathbf{b}
a×b|\mathbf{a}\times\mathbf{b}|
θ\theta
a×b\mathbf{a}\times\mathbf{b}

Note that if a\mathbf{a} and b\mathbf{b} have a length of one, the length of the cross product is only one when θ=90\theta=90^\circ, as sinθ=1\sin\theta=1.

Another definition of the cross-product keeps the direction of the cross product in a unit vector n^\hat{\mathbf{n}} perpendicular to a\mathbf{a} and b\mathbf{b} such that:

a×b=n^absinθ\mathbf{a}\times\mathbf{b}=\hat{\mathbf{n}}|\mathbf{a}||\mathbf{b}|\sin\theta

From which is also obvious that collinear (parallel) vectors a\mathbf{a} and b\mathbf{b} result in sinθ=0\sin\theta=0 and thus a×b=0\mathbf{a}\times\mathbf{b} = \mathbf{0}

To derive the cross product c=a×b\mathbf{c} = \mathbf{a}\times\mathbf{b}. From the definition that c\mathbf{c} is orthogonal to both, a\mathbf{a} and b\mathbf{b}, we know that

ac=axcx+aycy+azcz=0\mathbf{a}\cdot\mathbf{c} = a_xc_x+a_yc_y+a_zc_z=0

bc=bxcx+bycy+bzcz=0\mathbf{b}\cdot\mathbf{c} = b_xc_x+b_yc_y+b_zc_z=0

To eliminate czc_z we multiply the first equation by bzb_z and the second by aza_z and subtract:

(axbzazbx)cx+(aybzazby)cy=0(a_xb_z-a_zb_x)c_x + (a_yb_z-a_zb_y)c_y=0

This equation has the form pcx+qcy=0pc_x+qc_y=0, for which an obvious solution is cx=qc_x=q and cy=pc_y=-p. Thus

cx=aybzazbyc_x=a_yb_z-a_zb_ycy=azbxaxbzc_y=a_zb_x-a_xb_z

and by substituting in the original equations:

cz=axbyaybxc_z=a_xb_y-a_yb_x

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^\hat{\mathbf{x}}, \hat{\mathbf{y}} and z^\hat{\mathbf{z}} being the orthonormal basis.:

a×b=x^y^z^axayazbxbybz=x^ayazbybzy^axazbxbz+z^axaybxby=x^(aybzazby)y^(azbxaxbz)+z^(axbyaybx)=(aybzazbyazbxaxbzaxbyaybx)\begin{array}{rl} \mathbf{a}\times\mathbf{b} &= \left|\begin{array}{ccc}\hat{\mathbf{x}}&\hat{\mathbf{y}}&\hat{\mathbf{z}}\\ a_x & a_y & a_z\\ b_x & b_y & b_z \end{array} \right|\\ &= \hat{\mathbf{x}}\left|\begin{array}{cc} a_y & a_z\\ b_y & b_z \end{array} \right| - \hat{\mathbf{y}}\left|\begin{array}{cc} a_x & a_z\\ b_x & b_z \end{array} \right| + \hat{\mathbf{z}}\left|\begin{array}{cc} a_x & a_y\\ b_x & b_y \end{array} \right|\\ &= \hat{\mathbf{x}}(a_yb_z-a_zb_y) - \hat{\mathbf{y}}(a_zb_x-a_xb_z) + \hat{\mathbf{z}}(a_xb_y-a_yb_x)\\ &= \left(\begin{array}{c} a_yb_z-a_zb_y\\ a_zb_x-a_xb_z\\ a_xb_y-a_yb_x \end{array}\right) \end{array}

Cross Product Properties

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\mathbf{a}, your middle finger b\mathbf{b} then your thumb is the positive cross product a×b\mathbf{a}\times\mathbf{b}.

a×b=(b×a)=(b)×a\mathbf{a}\times\mathbf{b}=-(\mathbf{b}\times\mathbf{a}) = (-\mathbf{b})\times\mathbf{a}

Additive Distribution

a×(b+c)=a×b+a×c\mathbf{a}\times(\mathbf{b}+\mathbf{c}) = \mathbf{a}\times\mathbf{b}+\mathbf{a}\times\mathbf{c}

(a+b)×c=a×c+b×c(\mathbf{a}+\mathbf{b})\times\mathbf{c} = \mathbf{a}\times\mathbf{c}+\mathbf{b}\times\mathbf{c}

Großmann Identity or Double vector product

Left Association

(a×b)×c=(ac)b(bc)a(\mathbf{a}\times\mathbf{b})\times\mathbf{c} = (\mathbf{a}\cdot\mathbf{c})\mathbf{b} - (\mathbf{b}\cdot\mathbf{c})\mathbf{a}

Right Association

a×(b×c)=(ac)b(ab)c\mathbf{a}\times(\mathbf{b}\times\mathbf{c}) = (\mathbf{a}\cdot\mathbf{c})\mathbf{b} - (\mathbf{a}\cdot\mathbf{b})\mathbf{c}

Lie Identity

a×(b×c)+c×(a×b)+b×(c×a)=0\mathbf{a}\times(\mathbf{b}\times\mathbf{c}) + \mathbf{c}\times(\mathbf{a}\times\mathbf{b}) + \mathbf{b}\times(\mathbf{c}\times\mathbf{a}) = \mathbf{0}

Dot-Cross Association

a(b×c)=(a×b)c\mathbf{a}\cdot(\mathbf{b}\times\mathbf{c}) = (\mathbf{a}\times\mathbf{b})\cdot\mathbf{c}

Scalar Association

(αa)(βb)=(αβ)(a×b)(\alpha\mathbf{a})\cdot(\beta\mathbf{b}) = (\alpha\beta)(\mathbf{a}\times\mathbf{b})

α(a×b)=(αa)×b=a×(αb)\alpha(\mathbf{a}\times\mathbf{b}) = (\alpha\mathbf{a})\times\mathbf{b} = \mathbf{a}\times(\alpha\mathbf{b})

Normality

(a×b)a=(a×b)b=0(\mathbf{a}\times\mathbf{b})\cdot\mathbf{a} = (\mathbf{a}\times\mathbf{b})\cdot\mathbf{b} = 0

Nilpotent

a×a=0\mathbf{a}\times\mathbf{a}=\mathbf{0}

a×0=0×a=0\mathbf{a}\times\mathbf{0} = \mathbf{0}\times\mathbf{a} = \mathbf{0}

Jacobi Identity

a×(b×c)+b×(c×a)+c×(a×b)=0\mathbf{a}\times(\mathbf{b}\times\mathbf{c}) + \mathbf{b}\times(\mathbf{c}\times\mathbf{a}) + \mathbf{c}\times(\mathbf{a}\times\mathbf{b}) = \mathbf{0}

Cyclic Permutations

The following cyclic permutations of cross products for the vectors a\mathbf{a}, b\mathbf{b} and c\mathbf{c} hold:

a×b=b×c=c×a\mathbf{a}\times\mathbf{b}=\mathbf{b}\times\mathbf{c}=\mathbf{c}\times\mathbf{a}

a×b+b×c+c×a=0\mathbf{a}\times\mathbf{b}+\mathbf{b}\times\mathbf{c}+\mathbf{c}\times\mathbf{a}=\mathbf{0}

Lagrange Identity

(a×b)(c×d)=(ac)(bd)(ad)(bc)(\mathbf{a}\times\mathbf{b})\cdot(\mathbf{c}\times\mathbf{d}) = (\mathbf{a}\cdot\mathbf{c})(\mathbf{b}\cdot\mathbf{d}) - (\mathbf{a}\cdot\mathbf{d})(\mathbf{b}\cdot\mathbf{c})

From which follows that the square of the norm is

a×b2=a2b2(ab)2|\mathbf{a}\times\mathbf{b}|^2 = |\mathbf{a}|^2|\mathbf{b}|^2 - (\mathbf{a}\cdot\mathbf{b})^2

which is a nice connection between the dot-product and the cross product. Especially with normalized vectors this is

a^×b^2=sin2θ=1(a^b^)2=cos2θ\underbrace{|\hat{\mathbf{a}}\times\hat{\mathbf{b}}|^2}_{=\sin^2\theta} = 1 - \underbrace{(\hat{\mathbf{a}}\cdot\hat{\mathbf{b}})^2}_{=\cos^2\theta}

But we can go further with the square of the norm:

a×b2=(a×b)(a×b)=(aa)(bb)(ab)2=a2b2(1cos2θ)=a2b2sin2θ\begin{array}{rl} |\mathbf{a}\times\mathbf{b}|^2 &= (\mathbf{a}\times\mathbf{b})\cdot(\mathbf{a}\times\mathbf{b})\\ &= (\mathbf{a}\cdot\mathbf{a})(\mathbf{b}\cdot\mathbf{b}) - (\mathbf{a}\cdot\mathbf{b})^2\\ &= |\mathbf{a}|^2|\mathbf{b}|^2(1-\cos^2\theta)\\ &= |\mathbf{a}|^2|\mathbf{b}|^2\sin^2\theta \end{array}

From which follows the definition of the cross product:

a×b=absinθ|\mathbf{a}\times\mathbf{b}|=|\mathbf{a}||\mathbf{b}|\sin\theta

Which works since the angle between a\mathbf{a} and b\mathbf{b} is always between 0° and 180° and therefore sinθ0\sin\theta\geq 0.

Scalar Triple Product

The dot-cross product a(b×c)\mathbf{a}\cdot(\mathbf{b}\times\mathbf{c}) has the name scalar triple product and is denoted by [a,b,c][\mathbf{a},\mathbf{b},\mathbf{c}]. It computes the (signed) volume of the parallelepiped spanned by the vectors a\mathbf{a}, b\mathbf{b} and c\mathbf{c}:

[a,b,c]=det(a  b  c)=a(b×c)=b(c×a)=c(a×b)\begin{array}{rl} [\mathbf{a},\mathbf{b},\mathbf{c}] &= \det(\mathbf{a}\;\mathbf{b}\;\mathbf{c})\\ &= \mathbf{a}\cdot (\mathbf{b}\times \mathbf{c})\\ &= \mathbf{b}\cdot (\mathbf{c}\times \mathbf{a})\\ &= \mathbf{c}\cdot (\mathbf{a}\times \mathbf{b})\\ \end{array}

The sign is positive if a\mathbf{a}, b\mathbf{b} and c\mathbf{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)\mathbf{a}\times(\mathbf{b}\times\mathbf{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 PP, QQ and RR and want to generate a unit vector n^\hat{\mathbf{n}} that is orthogonal to the plane formed by the three points.

Now a=QP\mathbf{a}=Q-P and b=RP\mathbf{b}=R-P and the normal can be found with n=a×b\mathbf{n}=\mathbf{a}\times\mathbf{b}. The direction of the normal is usually chosen to point from the inside to the outside of our object.

Interestingly, the length n|\mathbf{n}| here equals twice the area of the triangle (since halve of the parallelogram formed by a\mathbf{a} and b\mathbf{b} is our triangle).

Equation of a plane given three points

Given three points P1P_1, P2P_2, P3P_3, we can form two vectors v1=P1P2\mathbf{v}_1=\vec{P_1P_2} and v2=P1P3\mathbf{v}_2=\vec{P_1P_3} that lie in that plane. Now let P=(x,y,z)TP=(x,y,z)^T be a general point in space. PP lies in the plane iff the vector v3=P1P\mathbf{v}_3=\vec{P_1P} lies in that plane, which is the case if and only if the volume of the parallelepiped spanned by v1,v2,v3\mathbf{v}_1, \mathbf{v}_2, \mathbf{v}_3 is zero and therefore the Scalar Triple Product:

[v1,v2,v3]=0[\mathbf{v_1},\mathbf{v_2},\mathbf{v_3}] = 0

This is enough to solve for the plane equation. Another method fixes a point, i.e. P1P_1, in the plane and requiring that every vector in the plane will tail P1P_1 and is normal to n\mathbf{n}. Therefore

n=v1×v2\mathbf{n} = \mathbf{v}_1\times\mathbf{v}_2

is one normal to the plane. Now PP is in the plane if and only if v3\mathbf{v}_3 is orthogonal to n\mathbf{n}.

v3n=0\mathbf{v}_3\cdot\mathbf{n} = 0

From there the typical plane equation can be read off, which has the form

(xP1,x)nx+(yP1,y)ny+(zP1,z)nz=0(x-P_{1,x})\mathbf{n}_x+(y-P_{1,y})\mathbf{n}_y+(z-P_{1,z})\mathbf{n}_z=0

Distance between two lines

Consider two lines in space 1\ell_1 and 2\ell_2 such that point 1\ell_1 passes through P1P_1 and is parallel to vector v1\mathbf{v}_1 and 2\ell_2 passes through P2P_2 and is parallel to v2\mathbf{v}_2. We want to compute the smallest distance dd between the two lines.

If the lines intersect, the distance is d=0d=0.

If they are parallel, then dd corresponds to the distance between point P2P_2 and 1\ell_1:

d=P1P2×v1v1d=\frac{\|\overrightarrow{P_1P_2}\times\mathbf{v}_1\|}{\|\mathbf{v}_1\|}

If the lines are not paralll and do not intersect (skew lines) then let n=v1×v2\mathbf{n}=\mathbf{v}_1\times\mathbf{v}_2 be a vector perpendicular to both lines. The projection of vector onto n\mathbf{n} gives dd:

d=P1P2nnd=\frac{|\overrightarrow{P_1P_2}\cdot\mathbf{n}|}{\|\mathbf{n}\|}

Test if two vectors are parallel

Like the dot product, the cross product can be used to determine if two vectors a\mathbf{a} and b\mathbf{b} are parallel, which is the case when a×b=0\mathbf{a}\times\mathbf{b}=\mathbf{0}. This result comes directly from the definition of the length of the cross product, since sin(θ)=0\sin(\theta)=0 for 0° and 180°. Calculating a×b=0|\mathbf{a}\times\mathbf{b}|=0 or simply (a×b)(a×b)=0(\mathbf{a}\times\mathbf{b})\cdot(\mathbf{a}\times\mathbf{b})=0 has the advantage of using less operations with nonnormalized vectors over the parallel-test using the dot-product.