
12 Cross Products
SageMath Spotlight
- Computing Cross Products
v.cross_product(w)
The contents of this lecture only make sense for vectors in \(\mathbb{R}^3\), because \(3 = 2+1\)!
While the dot product gives us a way to multiply two vectors and get a scalar, there is another incredibly useful way to multiply two vectors that outputs a vector. However, this operation only works in three-dimensional space \(\mathbb{R}^3\).
Idea of the Cross Product
When we have two distinct, non-parallel vectors, they span a 2-dimensional plane. In 3D space, that leaves one dimension left over for a perpendicular direction to point in—it is along this axis that we choose the vector resulting from the cross product. Note that, in 4D, there would be two perpendicular directions, and in 2D, there are none, and so this notion of turning two vectors into a third cannot make sense in the same way.
12.1 Areas and Determinants
To motivate the cross product, we first consider the problem of measuring area in 2D. If we have two vectors \(\vec{a} = \langle a_1, a_2 \rangle\) and \(\vec{b} = \langle b_1, b_2 \rangle\) in the \(xy\)-plane, they define a parallelogram. We can draw a bounding box around them to visualize how to calculate the area, \(A\):
The area of the large outer rectangle can be written in two different ways. First, by multiplying its total width \((a_1 + b_1)\) by its total height \((a_2 + b_2)\): \[ (a_1 + b_1)(a_2 + b_2) = a_1 a_2 + a_1 b_2 + b_1 a_2 + b_1 b_2. \] Second, we can add up the areas of all the smaller shapes inside the box. As seen in the diagram, the bounding box is made up of:
- The parallelogram in the middle (Area \(= A\))
- Two identical triangles above and below the parallelogram (Area \(= 2 \cdot \frac{a_1 a_2}{2}\))
- Two identical triangles on the left and right (Area \(= 2 \cdot \frac{b_1 b_2}{2}\))
- Two identical rectangles in the top-left and bottom-right corners (Area \(= 2 a_2 b_1\))
We equate these expressions, then simplify: \[ \begin{aligned} a_1 a_2 + a_1 b_2 + b_1 a_2 + b_1 b_2 & = A + a_1 a_2 + b_1 b_2 + 2 a_2 b_1 \\ a_1 b_2 + b_1 a_2 & = A + 2 a_2 b_1 \\ A & = a_1 b_2 - a_2 b_1. \end{aligned} \]
This expression is the \(2 \times 2\) determinant of a matrix, which we denote with vertical bars: \[ A = \begin{vmatrix} a_1 & a_2 \\ b_1 & b_2 \end{vmatrix} \coloneqq a_1 b_2 - a_2 b_1. \] This concept will be explored in linear algebra, but we can adopt the notation here because of its convenience. To compute the determinant of a \(2 \times 2\) matrix, we multiply along the main diagonal (\(a_1 b_2\)) and subtract the product of the off-diagonal (\(a_2 b_1\)).
Recall that the area of a parallelogram is base times height. If the angle between the two vectors is \(\theta\), the height is \(\left\lVert \vec{b} \right\rVert\sin\theta\), giving us an alternative, coordinate-free area formula: \[ A = \left\lVert \vec{a} \right\rVert\left\lVert \vec{b} \right\rVert\sin\theta. \]
From Area to Volume
In Math 134: Linear Algebra with Applications, we will explore determinants for arbitrarily large square matrices. For our purposes, if a \(2 \times 2\) determinant measures area, it is natural to ask what a \(3 \times 3\) determinant captures. If we introduce a third vector \(\vec{c} = \langle c_1, c_2, c_3 \rangle\), the three vectors \(\vec{a}\), \(\vec{b}\), and \(\vec{c}\) form an object called a parallelepiped. The volume of this box is given by a \(3 \times 3\) determinant: \[ V = \begin{vmatrix} c_1 & c_2 & c_3 \\ a_1 & a_2 & a_3 \\ b_1 & b_2 & b_3 \end{vmatrix}. \] Determinants are defined recursively: in this case, the volume we are after can be obtained in terms of the various areas that result from projecting vectors into the coordinate planes. The standard formula is: \[ \begin{vmatrix} c_1 & c_2 & c_3 \\ a_1 & a_2 & a_3 \\ b_1 & b_2 & b_3 \end{vmatrix} = \begin{vmatrix} a_2 & a_3 \\ b_2 & b_3 \end{vmatrix} c_1 - \begin{vmatrix} a_1 & a_3 \\ b_1 & b_3 \end{vmatrix} c_2 + \begin{vmatrix} a_1 & a_2 \\ b_1 & b_2 \end{vmatrix} c_3. \tag{12.1}\]
Note that, geometrically, if the vector \(\vec{c}\) is swiveled into the plane formed by \(\vec{a}\) and \(\vec{b}\), the “box” is flattened to have zero height, meaning it spans no volume: \(V = 0\). This geometry is encoded in what algebraists call an alternating property: if any row is repeated in the matrix, its determinant must be zero. Though we will not dwell on them, these subtle issues of signs will be very important in linear algebra!
12.2 Defining the Cross Product
We want to define a new vector \(\vec{a} \times \vec{b}\) (Stewart et al. 2020, 12.4, pp. 855) that captures the geometry of the plane spanned by \(\vec{a}\) and \(\vec{b}\). In particular, we want its direction to be strictly perpendicular to that plane, and its length to equal the 2D area of the parallelogram formed by \(\vec{a}\) and \(\vec{b}\) as in Section 12.1. If we replace the top row of the volume determinant (Equation 12.1) with the standard basis vectors \(\mathbf{i}, \mathbf{j}, \mathbf{k}\), the determinant machinery will output exactly the vector we are looking for:
\[ \vec{a} \times \vec{b} \coloneqq \begin{vmatrix} \mathbf{i}& \mathbf{j}& \mathbf{k}\\ a_1 & a_2 & a_3 \\ b_1 & b_2 & b_3 \end{vmatrix} = \begin{vmatrix} a_2 & a_3 \\ b_2 & b_3 \end{vmatrix} \mathbf{i} - \begin{vmatrix} a_1 & a_3 \\ b_1 & b_3 \end{vmatrix} \mathbf{j} + \begin{vmatrix} a_1 & a_2 \\ b_1 & b_2 \end{vmatrix} \mathbf{k}. \]
The Negative Sign and the Right-Hand Rule
Don’t forget the negative sign on the middle term! This is not an arbitrary choice; it is a direct consequence of the alternating property of volume mentioned earlier. Mathematically, it corrects the orientation of the coordinates as we move from the \(yz\)-plane to the \(xz\)-plane.
12.3 Geometric Properties of the Cross Product
Now that we have computed this new vector \(\vec{a} \times \vec{b}\), what does it actually look like? By carefully expanding the dot products \((\vec{a} \times \vec{b}) \cdot \vec{a}\) and \((\vec{a} \times \vec{b}) \cdot \vec{b}\) using our determinant definition—or by trusting the algebraists about that alternating property—we can show that the terms cancel out to zero! This verifies our primary geometric goal (Stewart et al. 2020, 12.4, pp. 857):
The cross product \(\vec{a} \times \vec{b}\) is orthogonal to both \(\vec{a}\) and \(\vec{b}\).
Here is a visualization of this geometry. The vectors \(\vec{a}\) (blue) and \(\vec{b}\) (red) span a flat 2D plane. There are exactly two directions orthogonal to this plane: pointing “up” (green) or pointing “down” (purple). Notice that any other arbitrary vector \(\vec{v}\) (grey) that lives inside the plane is also perfectly perpendicular to both normal vectors.
The vectors \(\vec{a}\) (blue) and \(\vec{b}\) (red) span a flat 2D plane, and there are two directions orthogonal to it: pointing up (green) or down (purple).
We use the Right-Hand Rule to determine which way \(\vec{a} \times \vec{b}\) actually points along this perpendicular axis: if we point the fingers of our right hand in the direction of \(\vec{a}\) and curl them toward \(\vec{b}\), our thumb points in the direction of \(\vec{a} \times \vec{b}\). Moreover, returning to the motivation in Section 12.1, some algebra yields a coordinate-free formula for the magnitude of the cross product (Stewart et al. 2020, 12.4, pp. 857): \[ \begin{aligned} \left\lVert \vec{a} \times \vec{b} \right\rVert^2 & = (a_2b_3 - a_3b_2)^2 + (a_3b_1-a_1b_3)^2 + (a_1b_2-a_2b_1)^2 \\ & = (a_1^2+a_2^2+a_3^2)(b_1^2+b_2^2+b_3^2) - (a_1b_1 + a_2b_2 + a_3b_3)^2 \\ & = \left\lVert \vec{a} \right\rVert^2 \left\lVert \vec{b} \right\rVert^2 - (\vec{a} \cdot \vec{b})^2 \\ & = \left\lVert \vec{a} \right\rVert^2 \left\lVert \vec{b} \right\rVert^2 - \left\lVert \vec{a} \right\rVert^2 \left\lVert \vec{b} \right\rVert^2 \cos^2 \theta \\ & = \left\lVert \vec{a} \right\rVert^2 \left\lVert \vec{b} \right\rVert^2 (1 - \cos^2 \theta) \\ & = \left\lVert \vec{a} \right\rVert^2 \left\lVert \vec{b} \right\rVert^2 \sin^2 \theta. \\ \end{aligned} \] Taking square roots (and noting that \(\sin \theta \geq 0\) for \(0 \leq \theta \leq \pi\)) gives:
The Cross Product Sine Formula
If \(\theta\) is the angle between the vectors \(\vec{a}\) and \(\vec{b}\) (with \(0 \le \theta \le \pi\)), then the magnitude of their cross product is: \[ \left\lVert \vec{a} \times \vec{b} \right\rVert = \left\lVert \vec{a} \right\rVert \left\lVert \vec{b} \right\rVert \sin \theta. \]
This gives us two useful corollaries (Stewart et al. 2020, 12.4, pp. 858):
Let \(\vec{a}\) and \(\vec{b}\) be non-zero vectors.
- \(\left\lVert \vec{a} \times \vec{b} \right\rVert\) is equal to the area of the parallelogram spanned by \(\vec{a}\) and \(\vec{b}\).
- \(\vec{a}\) and \(\vec{b}\) are parallel if and only if \(\vec{a} \times \vec{b} = \vec{0}\).
12.4 Cyclic Identities of the Standard Basis
To get a feel for how the cross product behaves, we can apply it to the standard basis vectors \(\mathbf{i}\), \(\mathbf{j}\), and \(\mathbf{k}\). For example: \[ \mathbf{i}\times \mathbf{j}= \begin{vmatrix} \mathbf{i}& \mathbf{j}& \mathbf{k}\\ 1 & 0 & 0 \\ 0 & 1 & 0 \end{vmatrix} = \begin{vmatrix} 0 & 0 \\ 1 & 0 \end{vmatrix} \mathbf{i} - \begin{vmatrix} 1 & 0 \\ 0 & 0 \end{vmatrix} \mathbf{j} + \begin{vmatrix} 1 & 0 \\ 0 & 1 \end{vmatrix} \mathbf{k}= \mathbf{k}. \] Indeed, since these vectors all have a length of \(1\) and are mutually orthogonal, the cross product of any two will yield the third—but the sign depends on the order!

Following the diagram in the clockwise direction gives a positive result, while traversing it backwards (dashed) introduces a negative sign. This gives us our cyclic identities:
- \(\mathbf{i}\times \mathbf{j}= \mathbf{k}\) but \(\mathbf{j}\times \mathbf{i}= -\mathbf{k}\)
- \(\mathbf{j}\times \mathbf{k}= \mathbf{i}\) but \(\mathbf{k}\times \mathbf{j}= -\mathbf{i}\)
- \(\mathbf{k}\times \mathbf{i}= \mathbf{j}\) but \(\mathbf{i}\times \mathbf{k}= -\mathbf{j}\)
Moreover, we also know that \(\mathbf{i}\times \mathbf{i}= \vec{0} = \mathbf{j}\times \mathbf{j}= \mathbf{k}\times \mathbf{k}\), since they are parallel to themselves!
12.5 Algebraic Properties
Because the cross product is tied so heavily to the Right-Hand Rule and the alternating property of determinants, it behaves a bit differently than standard multiplication (Stewart et al. 2020, 12.4, pp. 859). Let \(\vec{a}, \vec{b}, \vec{c}\) be vectors in \(\mathbb{R}^3\) and let \(c\) be a scalar:
- Anticommutativity: \(\vec{a} \times \vec{b} = -\vec{b} \times \vec{a}\)
- Scalar Compatibility: \((c\vec{a}) \times \vec{b} = c(\vec{a} \times \vec{b}) = \vec{a} \times (c\vec{b})\)
- Left Distribution over Addition: \(\vec{a} \times (\vec{b} + \vec{c}) = \vec{a} \times \vec{b} + \vec{a} \times \vec{c}\)
- Right Distribution over Addition: \((\vec{a} + \vec{b}) \times \vec{c} = \vec{a} \times \vec{c} + \vec{b} \times \vec{c}\)
12.6 Volumes and the Triple Scalar Product
We introduced the cross product by replacing the top row of a \(3 \times 3\) volume determinant with the basis vectors \(\mathbf{i}, \mathbf{j}, \mathbf{k}\). If we instead leave all three vectors \(\vec{a}, \vec{b}, \vec{c}\) in the matrix, we are computing a mix of the dot and cross products simultaneously. Indeed, we can rewrite Equation 12.1 as: \[ \begin{vmatrix} c_1 & c_2 & c_3 \\ a_1 & a_2 & a_3 \\ b_1 & b_2 & b_3 \end{vmatrix} = \langle c_1,c_2,c_3 \rangle \cdot \left\langle\begin{vmatrix} a_2 & a_3 \\ b_2 & b_3 \end{vmatrix}, - \begin{vmatrix} a_1 & a_3 \\ b_1 & b_3 \end{vmatrix}, \begin{vmatrix} a_1 & a_2 \\ b_1 & b_2 \end{vmatrix}\right\rangle = \vec{c} \cdot (\vec{a} \times \vec{b}) \] Rearranging these into alphabetical order for convenience, we get the triple scalar product defined in the textbook (Stewart et al. 2020, 12.4, pp. 860): \[ \vec{a} \cdot (\vec{b} \times \vec{c}) = \begin{vmatrix} a_1 & a_2 & a_3 \\ b_1 & b_2 & b_3 \\ c_1 & c_2 & c_3 \end{vmatrix} \] Because of the geometric interpretation of \(3 \times 3\) determinants discussed earlier, the absolute value of the triple scalar product gives the volume of the parallelepiped formed by the vectors \(\vec{a}, \vec{b}\), and \(\vec{c}\):
\[ V = \vert{\vec{a} \cdot (\vec{b} \times \vec{c})}\vert \]
A nifty consequence of how determinants work is that cyclically shifting the rows of a matrix twice leaves the determinant unchanged. In the language of vectors, this gives us a handy algebraic identity: \[ \vec{a} \cdot (\vec{b} \times \vec{c}) = (\vec{a} \times \vec{b}) \cdot \vec{c}. \] Again, there is a sensible geometric interpretation of this formula. Whether we compute the base area using \(\vec{b}\) and \(\vec{c}\) and multiply by the height along \(\vec{a}\), or compute the base area using \(\vec{a}\) and \(\vec{b}\) and multiply by the height along \(\vec{c}\), the volume of the box remains the same.