# The Cross Product

Posted on Mon 01 October 2018 in Thesis

We're nearly ready to give the geometric interpretation of quaternionic multiplication that we've been working toward ever since we first defined the quaternions. Instead of considering the four-dimensional quaternions, we've spent the last few posts considering three-dimensional vectors, specifically discussing a product operation called the dot product that we can use to understand geometry in three dimensions. In this post, we'll introduce a second product operation in three dimensions, the so-called cross product.

### Intuition for the Cross Product

The cross product is an operation that takes in two three-dimensional vectors and returns a three dimensional vector. (Recall that the dot product, in contrast, takes in two vectors and returns a number.) In order to see how this operation works, notice that if we're given two arbitrary vectors in $$\mathbb{R}^3$$, then chances are these two vectors will determine a two-dimensional plane in $$\mathbb{R}^3$$. For a simple example, the two vectors $$\mathbf{e}_1 = (1,0,0)$$ and $$\mathbf{e}_2 = (0,1,0)$$ that point in the $$x$$ and $$y$$ directions in our standard picture determine the $$xy$$-plane, the set of all points with $$z$$ coordinate equal to $$0$$:

Two vectors determine a plane

One way to visualize the plane created by two vectors is to see that if we add two vectors using the parallelogram method, then the parallelogram enclosed by the vectors can be extended to the plane determined by the two vectors. We can use this to visualize the plane determined by the vectors $$(1,2,3)$$ and $$(0,-2,-1)$$, shown in red and blue, respectively, in the picture below.

Parallelogram method to visualize the plane determined by two vectors

Considering the parallelogram rule for addition is also helpful for understanding the conditions for which two different vectors don't actually determine a unique plane. This occurs when the two given vectors don't make a parallelogram under vector addition because they point either in the same direction or in exactly opposite directions. As we see illustrated below, in this case there are many possible planes that contain both vectors, instead of just one.

Multiple planes containing by vectors in opposite directions

For example in the picture above the two vectors $$(2,0,0)$$ and $$(-3,0,0)$$, which point in opposite directions, can both be contained in many different planes, including the $$xy$$-plane and the $$xz$$-plane, consisting of points that have $$y$$-coordinate equal to zero. We can also produce many other planes containing these vectors by rotation.

Therefore we have that, given two vectors in $$\mathbb{R}^3$$, we can usually use them to define a plane. The observation that leads to the cross product is to note that there is a second way to describe a plane in $$\mathbb{R}^3$$, using a normal vector. A vector is said to be a normal to a plane if that vector is orthogonal (perpendicular) to any vector that sits in the plane. Conversely, given a vector, we can produce a plane by considering all of the vectors orthogonal to the given one. These two processes are illustrated below.

Describing a plane by a normal vector

In the picture above, we see that the plane is determined by the blue vector $$(1,0,0)$$ and the red vector $$(0,2,-1)$$. This plane can also be described by considering a normal vector, shown in black. This vector is the vector $$(0,1,2)$$, and it's not hard to see that any vector that lies in the plane will be perpendicular to this vector.

Thus we have a method to take two vectors and produce a plane, and then to take a plane and produce a normal vector. Putting these two processes together, we obtain the cross product. That is, the cross product is the operation that takes in two vectors and returns a vector that is normal to the plane determined by those two vectors.

There is a slight problem with this definition: given a plane, there is not a unique normal vector to that plane. This is illustrated below:

Normal vectors are not unique

This is the same plane as above, and the black vector is also the same. We can see, though, that it is not the only vector normal to the plane - the blue vector, which points in the same direction as the black vector, is also normal, as is the red vector, which points in the exact opposite direction.

Instead of being determined by a single normal vector, a plane is determined by a single normal line. We can then pick many different normal vectors by choosing a direction and a length along that line. Therefore in order to fully define the cross product we need to decide on a systematic way to assign a length and a direction to the normal vector that we pick.

We'll consider length first. Given vectors $$\mathbf{v}, \mathbf{w}$$, we choose the length of the cross product vector, which is written as $$\mathbf{v} \times \mathbf{w}$$, by saying that

\begin{equation*} \| \mathbf{v} \times \mathbf{w} \| = \| \mathbf{v} \| \, \| \mathbf{w} \| \sin \theta \end{equation*}

where $$\theta$$ is the angle between the vectors $$\mathbf{v}$$ and $$\mathbf{w}$$. Recall that all of these lengths and angles can be measured by using the dot product operation defined in the previous post.

Why do we make this choice? Recall from above that we can consider the plane defined by the vectors $$\mathbf{v}$$ and $$\mathbf{w}$$ as extending the area inside the parallelogram associated to those two vector via vector addition. The number $$\| \mathbf{v} \| \, \| \mathbf{w} \| \sin \theta$$ is then exactly the area of this parallelogram. Another important point is to notice that in the case that the vectors $$\mathbf{v}$$ and $$\mathbf{w}$$ are on the same line, and therefore don't define a unique plane, then the angle between them is either $$\theta = 0^\circ$$ or $$\theta = 180^\circ$$, and in either case we have $$\sin 0^\circ = \sin 180^\circ = 0$$. Therefore the cross product of two vectors that don't actually determine a unique plane is the zero vector $$\mathbf{0} = (0,0,0)$$. Note that this means that the cross product is not a multiplication operation - we can take two non-zero vectors and their cross product can be the zero vector. This means, following the general discussion from a few posts back, that there is no way to define a "division" operation that is inverse to the cross product operation.

There's still one issue remaining in defining the cross product. We've seen how to get the length of the cross product vector, but still can't be certain of the direction. For a simple example, we can return to the situation of the vectors $$\mathbf{e}_1 = (1,0,0)$$ and $$\mathbf{e}_2 = (0,1,0)$$. As we said above, the plane associated to these vectors is the $$xy$$-plane, and we see that any vector of the form $$(0,0,z)$$ will be normal to this plane. Using the formula for lengths described above, we therefore have that $$\mathbf{e}_1 \times \mathbf{e}_2$$ should be either $$\mathbf{e}_3 = (0,0,1)$$ or $$-\mathbf{e}_3 = (0,0,-1)$$, as these are the two unit vectors that point in the $$z$$ direction. But which one should it be?

We can choose either one, and the standard choice is to choose $$(0,0,1)$$, so that $$\mathbf{e}_1 \times \mathbf{e_2} = \mathbf{e}_3$$. This choice can be remembered using the right-hand rule for the cross product. To find the direction of the cross-product $$\mathbf{v} \times \mathbf{w}$$, you can begin by pointing the fingers of your right hand in the direction of the vector $$\mathbf{v}$$, then curling your fingers toward the vector $$\mathbf{w}$$, as if making a fist. If you extend your thumb while making this motion, then it points in the direction of the cross product vector $$\mathbf{v} \times \mathbf{w}$$.

Right hand rule

This is shown in the picture above. If you begin with the fingers of your right hand pointing out of the page in the direction of $$\mathbf{e}_1 = (1,0,0)$$, which is shown in red in the above picture, and then curl them to $$\mathbf{e}_2 = (0,1,0)$$, which is shown in blue, then your hand will curl and rotate in the direction of the black arrow, and your thumb will point upward, in the direction of $$\mathbf{e}_3 = (0,0,1)$$, shown in green.

Note that this choice is totally arbitrary - we could just as well have chosen to define $$\mathbf{e}_1 \times \mathbf{e}_2 = (0,0,-1)$$, which would correspond to the left-hand rule for determining the direction of the cross product.

The fact that we have to make this choice means that the order of the elements of the cross product matters. This can be verified by example - if you use the right-hand rule to determine the direction of $$\mathbf{e}_2 \times \mathbf{e}_1$$, you'll notice that your thumb points down instead of up, that is, $$\mathbf{e}_2 \times \mathbf{e}_1 = (0,0,-1) = -\mathbf{e}_3$$. This means that the cross product is not commutative - in general, $$\mathbf{v} \times \mathbf{w}$$ and $$\mathbf{w} \times \mathbf{v}$$ are not the same vector. In fact, it's not hard to see that $$\mathbf{v} \times \mathbf{w} = - \mathbf{w} \times \mathbf{v}$$, that is, changing the order of the cross product changes the direction of the resulting vector. For this reason, we say that the cross product is anti-commutative - it commutes, but with a minus sign. You might remember that quaternionic multiplication is also not commutative - we'll return to this point in the next post.

### Formula for the Cross Product

To summarize, the cross product is a procedure that takes in two vectors $$\mathbf{v}$$ and $$\mathbf{w}$$, and returns a third vector. If $$\mathbf{v}$$ and $$\mathbf{w}$$ together determine a plane, then this third vector is perpendicular to that plane, with length and direction determined by the choices above. If $$\mathbf{v}$$ and $$\mathbf{w}$$ do not determine a unique plane, the cross product is just the zero vector $$\mathbf{0} = (0,0,0)$$.

Understanding the above geometric interpretation of the cross product is the most important part of this post, but it isn't useful for actual computations. In order to compute, we need the following formula. If $$\mathbf{v} = (v_1, v_2, v_3)$$ and $$\mathbf{w} = (w_1, w_2, w_3)$$ are two vectors, then their cross product is given by the formula

\begin{equation*} \mathbf{v} \times \mathbf{w} = (v_2 w_3 - v_3 w_2, -v_1 w_3 + v_3 w_1, v_1 w_2 - v_2 w_1 ) \end{equation*}

Let's check that this is the correct formula. First, the above formula does define an anti-commutative operation - if you exchange all of the $$v$$'s and $$w$$'s in the above formula, you'll get the same vector, but multiplied by $$-1$$ in each entry. Next, we observe that the formula above follows the right-hand rule - we can easily check that $$(1,0,0) \times (0,1,0) = (0,0,1)$$, that is, $$\mathbf{e}_1 \times \mathbf{e}_2 = \mathbf{e}_3$$, using this formula.

For a third check, we can observe that the vectors $$\mathbf{v}$$ and $$\mathbf{v} \times \mathbf{w}$$ are orthogonal. The dot product of these two vectors is zero, since

\begin{align*} \mathbf{v} \cdot (\mathbf{v} \times \mathbf{w}) &= (v_1, v_2, v_3) \times (v_2 w_3 - v_3 w_2, -v_1 w_3 + v_3 w_1, v_1 w_2 - v_2 w_1 ) \\ &= v_1 (v_2 w_3 - v_3 w_2) + v_2(-v_1 w_3 + v_3 w_1) + v_3(v_1 w_2 - v_2 w_1) \\ &= 0 \end{align*}

Anticommutativity then gives that $$\mathbf{w}$$ and $$\mathbf{v} \times \mathbf{w}$$ are also orthogonal. In order to be sure this formula is correct, it remains to show that the vector $$\mathbf{v} \times \mathbf{w}$$ that it defines has the proper length. We'll skip that check here, but the interested reader could try to prove that for themselves.

### Next Time - Finally Understanding the Quaternions

We now have both a geometric intuition and a number-crunching formula for the cross product, and with this understanding we're finally ready to consider quaternionic multiplication from a geometric point of view. In the next post, we'll see that quaternionic multiplication gives a way to combine the dot product and cross product into a single operation. Using this, we'll be able to understand quaternionic multiplication in terms of rotations and distances in three dimensions.