raw book

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

\[|\mathbf{a}\times\mathbf{b}|=|\mathbf{a}| |\mathbf{b}| \sin\theta\]

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

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

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


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

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

\[\mathbf{a}\cdot\mathbf{c} = a_xc_x+a_yc_y+a_zc_z=0\]

\[\mathbf{b}\cdot\mathbf{c} = b_xc_x+b_yc_y+b_zc_z=0\]

To eliminate \(c_z\) we multiply the first equation by \(b_z\) and the second by \(a_z\) and subtract:

\[(a_xb_z-a_zb_x)c_x + (a_yb_z-a_zb_y)c_y=0\]

This equation has the form \(pc_x+qc_y=0\), for which an obvious solution is \(c_x=q\) and \(c_y=-p\). Thus


and by substituting in the original equations:


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

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

\[\mathbf{a}\times\mathbf{b}=-(\mathbf{b}\times\mathbf{a}) = (-\mathbf{b})\times\mathbf{a}\]

Additive Distribution

\[\mathbf{a}\times(\mathbf{b}+\mathbf{c}) = \mathbf{a}\times\mathbf{b}+\mathbf{a}\times\mathbf{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

\[(\mathbf{a}\times\mathbf{b})\times\mathbf{c} = (\mathbf{a}\cdot\mathbf{c})\mathbf{b} - (\mathbf{b}\cdot\mathbf{c})\mathbf{a}\]

Right Association

\[\mathbf{a}\times(\mathbf{b}\times\mathbf{c}) = (\mathbf{a}\cdot\mathbf{c})\mathbf{b} - (\mathbf{a}\cdot\mathbf{b})\mathbf{c}\]

Lie Identity

\[\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

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

Scalar Association

\[(\alpha\mathbf{a})\cdot(\beta\mathbf{b}) = (\alpha\beta)(\mathbf{a}\times\mathbf{b})\]

\[\alpha(\mathbf{a}\times\mathbf{b}) = (\alpha\mathbf{a})\times\mathbf{b} = \mathbf{a}\times(\alpha\mathbf{b})\]


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



\[\mathbf{a}\times\mathbf{0} = \mathbf{0}\times\mathbf{a} = \mathbf{0}\]

Jacobi Identity

\[\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 \(\mathbf{a}\), \(\mathbf{b}\) and \(\mathbf{c}\) hold:



Lagrange Identity

\[(\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

\[|\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

\[\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:

\[\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:


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

Scalar Triple Product

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

\[\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 \(\mathbf{a}\), \(\mathbf{b}\) and \(\mathbf{c}\) form a right handed set and negative if they form a left handed set.

Vector Triple Product

The vector triple product is



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 \(\hat{\mathbf{n}}\) that is orthogonal to the plane formed by the three points.

Now \(\mathbf{a}=Q-P\) and \(\mathbf{b}=R-P\) and the normal can be found with \(\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 \(|\mathbf{n}|\) here equals twice the area of the triangle (since halve of the parallelogram formed by \(\mathbf{a}\) and \(\mathbf{b}\) is our triangle).

Equation of a plane given three points

Given three points \(P_1\), \(P_2\), \(P_3\), we can form two vectors \(\mathbf{v}_1=\vec{P_1P_2}\) and \(\mathbf{v}_2=\vec{P_1P_3}\) 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 \(\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 \(\mathbf{v}_1, \mathbf{v}_2, \mathbf{v}_3\) is zero and therefore the Scalar Triple Product:

\[[\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. \(P_1\), in the plane and requiring that every vector in the plane will tail \(P_1\) and is normal to \(\mathbf{n}\). Therefore

\[\mathbf{n} = \mathbf{v}_1\times\mathbf{v}_2\]

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

\[\mathbf{v}_3\cdot\mathbf{n} = 0\]

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


Distance between two lines

Consider two lines in space \(\ell_1\) and \(\ell_2\) such that point \(\ell_1\) passes through \(P_1\) and is parallel to vector \(\mathbf{v}_1\) and \(\ell_2\) passes through \(P_2\) and is parallel to \(\mathbf{v}_2\). 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 \(P_2\) and \(\ell_1\):


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


Test if two vectors are parallel

Like the dot product, the cross product can be used to determine if two vectors \(\mathbf{a}\) and \(\mathbf{b}\) are parallel, which is the case when \(\mathbf{a}\times\mathbf{b}=\mathbf{0}\). This result comes directly from the definition of the length of the cross product, since \(\sin(\theta)=0\) for 0° and 180°. Calculating \(|\mathbf{a}\times\mathbf{b}|=0\) or simply \((\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.