In his video on cross products, 3blue1brown kicks off by sharing that the cross product between two vectors
w is the area of a parallelogram created by affixing each vector to the end of the other. Mathematically, this is equivalent to the determinant.
from IPython.display import Image Image('images/cross_product_almost.PNG')
However, halfway through the video, he admits that this definition was simply to prep your understanding for the actual concept.
In reality, the cross product is a vector, not a number, that has the following properties:
- Its magnitude is still the value of the parallelogram’s area
- The resulting vector
pwinds up being perpendicular to both
- The direction that
ppoints coincides with the right-hand rule– correctly for positive values, opposite that for negative
This was a pretty simple example to ground our intuition. Because
w laid flat on the XY plane, the resulting normal vector,
p, will simply point up the
p gets a bit more complicated to work out when
w aren’t laid out so neatly. However, we’ll eschew the “just memorize it” formula we learned in undergrad and depend on
numpy to do the math.
Instead, let’s unpack 3b1b’s intuitive understanding between cross products and linear transformations.
The following tangent leans hard into the first bullet of our cross product definition, “the magnitude of
p is equal to the value of the area of the parallelogram spanned by
He then defines a problem and just asks us to go with it. You should, too, because it works.
Given that the volume of a parallelepiped is the determinant of the matrix of the 3 vectors, can we devise a function
f, that finds the volume of the solid, for a constant
wand a given vector
[x y z]T?
Couple things to note right away:
- This function is linear– because
ware held constant, we only ever consider one variable at a time
- This function maps a vector in 3 dimensions to the number line in 1D
Recognizing the linearity is critical, as it allows us to reframe the left-hand side as finding some 3-dimensional vector,
p, to multiply on the left of
[x y z]T to get the value on the right.
Moreover, due to our conversation of “duality” in our notebook on the Dot Product, we can express this same left-hand side as
np.dot([p1 p2 p3].T, [x y z].T)
And so by construction this equation has the special property that the vectors
p (orange, pink, red) stay completely the same, regardless of how our variable vector in white changes.
As constructed, the right-hand side of the equation is formula for the volume of a parallelepiped.
Geometrically, we know that the area of a parallelogram is equal to the height times the width. Expanding, the volume of a similarly-skewed prism is going to be the area of the base times the height.
We can easily calculate the area of the base by taking the determinant of
[v w], but how do we determine the height of the overall shape?
The answer jumps out soon as we represent this visually.
Finding the height of the parallelepiped has the nice property of also finding the vector that’s normal to both
w (in our definition of the cross product).
If we define a unit vector
u that’s perpendicular to the base, then we can summarize the right-hand side as
volume = np.dot(u, [x y z]T) * area_of_base
Reintroducing the left-hand side, we have
np.dot(p, [x y z]T) = np.dot(u, [x y z]T) * area_of_base
Reducing, we have
p = u * area_of_base
Which, to recap, perfectly describes our cross-product in that it:
- Has magnitude equal to the area spanned by
- Is perpendicular to the plane spanned by them (by construction of
At a term-by-term level, this looks like
which is very similar to the “just learn it, nerd” form that I learned years ago