The cross product, explained with pictures
The cross product multiplies two 3D arrows and gives you a new arrow. Turn the picture to see where that arrow points and how long it is.
Short answer. The cross product takes two 3D vectors and makes one new vector. That vector is at right angles to both. Its length is the area of the parallelogram the two make (‖a‖ ‖b‖ sin θ). The right-hand rule decides which way it points. The dot product gives a number. The cross product gives a vector.
Move the sliders or change the numbers. Turn the "View angle" slider to see the 3D shape better. The faint dotted lines drop from each arrow tip to the floor (z = 0). When an arrow gets long, the whole picture shrinks so that everything fits.
Definitions
The cross product is defined only for 3D vectors. a = (a₁, a₂, a₃) and b = (b₁, b₂, b₃) are vectors in ℝ³, and θ (0° ≤ θ ≤ 180°) is the angle between them.
- cross product
- The vector in the first formula below is the cross product of a and b. Let i, j, k be the unit vectors along the x, y and z axes, (1, 0, 0), (0, 1, 0) and (0, 0, 1). Then it can also be written as a 3×3 determinant with these three in the first row, expanded by cofactors along the first row (second formula). The first row is not numbers, so it is not a real determinant. It is a way of writing that helps you remember.
- magnitude
- The length of the cross product is the product of the two lengths and the sine of the angle between them. If a and b are parallel, or one of them is the zero vector, the cross product is the zero vector.
- direction and the right-hand rule
- a × b is orthogonal to both a and b. If a × b ≠ 0, its direction is where your right thumb points when you curl the four fingers of your right hand from a toward b (through the smaller angle).
- area of a parallelogram
- The area S of the parallelogram with sides a and b equals the length of the cross product. If both vectors lie in the xy plane (a₃ = b₃ = 0), it equals the absolute value of a 2×2 determinant.
1. What the cross product is
Put in two 3D vectors a and b, and you get one vector out. You write it a × b and say "a cross b." Three things decide the vector you get.
- Direction: it is at a right angle to a and also to b. If a and b lie on a sheet of paper, it points straight through the paper.
- Which side: there are two ways through the paper, up and down. The right-hand rule picks one.
- Length: the area of the parallelogram with a and b as two sides. It is the light orange shape in the picture.
Using the angle, the length is ‖a‖ ‖b‖ sin θ. Here θ is the angle between a and b (0° to 180°). sin θ is largest at 90°, where it is 1. It is 0 at 0° and at 180°. So the result is longest when a and b are at a right angle, and it is 0 when they are parallel.
2. The formula, part by part
Say a = (a1, a2, a3) and b = (b1, b2, b3). The numbers 1, 2, 3 stand for the x, y and z parts.
| Part you want | Numbers used | Formula |
|---|---|---|
| x (first) | 2, 3 | a2b3 − a3b2 |
| y (second) | 3, 1 | a3b1 − a1b3 |
| z (third) | 1, 2 | a1b2 − a2b1 |
How to remember it. Each part skips its own number and uses the other two. The numbers move around one step at a time: 1 → 2 → 3 → 1 (so 2, 3 then 3, 1 then 1, 2). Every row has the same shape: "a with the first number × b with the second number − a with the second number × b with the first number." The line under the experiment shows this working for each part.
To see why it has this shape, go to How the formula is built just below.
3. How the formula is built: from a parallelogram's area to the z part
Let's follow, picture by picture, where the third part a1b2 − a2b1 comes from. Two arrows a = (3, 1) and b = (2, 3) lie on the floor (z = 0). Work out the area of the parallelogram they make and you get this formula. That area is exactly the z part of the cross product.
Press "Next" to go one step at a time. The formula on top grows by one piece (the piece with the orange background is the new one), the picture changes to match, and the line below says why. Each grid square has an area of 1, so you can count squares to check.
Written only as equations, the steps above look like this. S is the area of the parallelogram.
- The parallelogram: area = ? This is the parallelogram with a and b as two of its sides. The sides are slanted, so you cannot multiply width by height. Base × height would need the height, which you would have to work out first.
- The box around it:
(a1 + b1)(a2 + b2). The far corner of the parallelogram is a + b = (5, 4). So the box that wraps it, with sides along the axes, is a1 + b1 = 5 wide and a2 + b2 = 4 tall, with area 20. Why: a box with sides along the axes takes just one multiplication. The parallelogram is this box with the corner pieces taken away. - Take away four triangles:
− a1a2 − b1b2. The corner triangles come in matching pairs. Each green triangle has the arrow a as its long side and short sides a1 = 3 and a2 = 1. One triangle is half of a 3 × 1 rectangle (1.5), so the two together make a1a2 = 3. Each blue triangle has b as its long side, so the two make b1b2 = 2 × 3 = 6. Left: 20 − 3 − 6 = 11. - Take away two small rectangles:
− 2a2b1. At the bottom right and the top left there is a purple rectangle, b1 = 2 wide and a2 = 1 tall. The two make 2 × 1 × 2 = 4. Left: 11 − 4 = 7. Now only the parallelogram remains. - Tidy up:
a1b2 − a2b1. Multiply out the box:(a1 + b1)(a2 + b2) = a1a2 + a1b2 + a2b1 + b1b2. Now take away a1a2, b1b2 and 2a2b1. The a1a2 and b1b2 cancel. There was one a2b1 and we took away two, so −a2b1 is left. Area = a1b2 − a2b1 = 3×3 − 1×2 = 7, the same 7 we got from the pieces. - Stand it up in 3D:
a × b = (0, 0, a1b2 − a2b1). Tilt the floor and look at it from an angle, like the experiment above. a = (3, 1, 0) and b = (2, 3, 0) lie on the floor, so the direction at right angles to both is straight up or straight down. That is why the x and y parts are 0. The length is the area of the parallelogram, 7. Seen from above, going from a to b turns counterclockwise, so the right-hand rule says up (+). Enter a = (3, 1, 0) and b = (2, 3, 0) in the experiment and you get a × b = (0, 0, 7).
The sign. The picture shows the case where every part of a and b is 0 or more, and b is counterclockwise from a when seen from above. If b is clockwise from a, swap the roles of a and b and draw the same picture. The area comes out as b1a2 − b2a1, so in that case a1b2 − a2b1 is the area with a minus sign. The right-hand rule agrees: then a × b points down. When some parts are negative, the pieces have different shapes. That the same formula still gives the area with a sign in those cases is not proved here.
The other two parts. The x part a2b3 − a3b2 and the y part a3b1 − a1b3 have the same shape, with the numbers moved one step around 1 → 2 → 3 → 1. If both arrows lie on the wall made by the y and z axes (both x parts are 0), you draw the same picture on that wall, and the result is (a2b3 − a3b2, 0, 0). The wall made by the z and x axes works the same way. When the arrows do not lie flat on any of these, each part is the area (with a sign) of the parallelogram's shadow on that surface. For example, the experiment's starting values a = (2, −2, 1) and b = (1, 1, 1) cast the shadows (2, −2) and (1, 1) on the floor. Their area 2×1 − (−2)×1 = 4 is the z part of the result (−3, −1, 4). Why the shadow of a slanted parallelogram has exactly the area of that part is not proved here.
4. Work one out by hand
Take a = (2, −2, 1) and b = (1, 1, 1). These are the starting values in the experiment.
| Step | Working | Value |
|---|---|---|
| ① x part | a2b3 − a3b2 = (−2)×1 − 1×1 = −2 − 1 | −3 |
| ② y part | a3b1 − a1b3 = 1×1 − 2×1 = 1 − 2 | −1 |
| ③ z part | a1b2 − a2b1 = 2×1 − (−2)×1 = 2 + 2 | 4 |
| ④ Answer | a × b | (−3, −1, 4) |
| ⑤ At a right angle to a? | a · (a × b) = 2×(−3) + (−2)×(−1) + 1×4 = −6 + 2 + 4 | 0 |
| ⑥ At a right angle to b? | b · (a × b) = 1×(−3) + 1×(−1) + 1×4 = −3 − 1 + 4 | 0 |
| ⑦ Length (area) | √((−3)² + (−1)² + 4²) = √26 | about 5.10 |
Written as equations, the same work looks like this.
The dot products in ⑤ and ⑥ are 0, so the answer really is at a right angle to both a and b. Now check ⑦ another way. ‖a‖ = 3, ‖b‖ = √3 ≈ 1.73, and a · b = 1, so the angle between them is about 78.9°. ‖a‖ ‖b‖ sin θ ≈ 3 × 1.73 × 0.981 ≈ 5.10. Same value.
5. Which way: the right-hand rule
There are two directions at right angles to both a and b (up and down). Your right hand picks one. Point the four fingers of your right hand along a, then curl them toward b (the short way around). Your thumb points along a × b. You can also use three fingers: point your index finger along a and your middle finger along b, and your thumb gives a × b.
The picture on this page follows the same rule. The axes are set up so that if you curl from the x axis toward the y axis, your thumb points along the z axis. Axes set up this way are called a right-handed coordinate system.
Try this. ① Enter a = (1, 0, 0) and b = (0, 1, 0). You get a × b = (0, 0, 1). The x axis × the y axis = the z axis. ② Press "Swap a and b." You get (0, 0, −1), pointing straight down. ③ Turn the "View angle" slider. The orange arrow always stands straight up from the parallelogram.
6. Properties worth knowing
| Property | Formula | What it means |
|---|---|---|
| Swapping the order flips it | a × b = −(b × a) | Same length, opposite direction. The order matters. |
| Parallel gives 0 | a × a = 0 | If a and b point the same way or opposite ways, the parallelogram is flat and its area is 0. It is also 0 if one of them has length 0. |
| At a right angle to both | a · (a × b) = 0, b · (a × b) = 0 | A dot product of 0 means a right angle. Use this to check your working. |
| Length = area | ‖a × b‖ = ‖a‖ ‖b‖ sin θ | Longest when a and b are at a right angle. |
| You can split it up | (k a) × b = k (a × b), a × (b + c) = a × b + a × c | Make a twice as long and the result is twice as long. Crossing a with b + c is the same as crossing a with b and with c separately, then adding. But when you chain three vectors, you cannot regroup them (see the common questions). |
Try this. Start from the starting values and press these in order. ① "Swap a and b": a × b goes from (−3, −1, 4) to (3, 1, −4). The length stays 5.1. ② Press it once more to go back, then "Lay them flat": a becomes (2, −2, 0), b becomes (1, 1, 0), and the result is (0, 0, 4), pointing straight up. The angle is 90°, so the parallelogram is a rectangle, and the length 4 is its area (√8 × √2 = 4). ③ "Swap a and b": (0, 0, −4), pointing straight down. ④ "Make b parallel to a": b becomes (2, 2, 0) and the result is (0, 0, 0). The angle is 0°.
7. In 2D it is just one number
If you set the z of a and b to 0, like "Lay them flat" does, the x and y parts of the result become 0. Only the z part is left: a1b2 − a2b1. That is why the "cross product" of 2D vectors is usually written as this one number.
This number is the same as the determinant of the 2×2 matrix with a and b as its columns. Its size is the area of the parallelogram (see How the formula is built for why), and its sign tells you the direction. Looking down from above, it is positive if you turn counterclockwise from a to b, and negative if you turn clockwise. For example, after "Lay them flat," (2, −2) and (1, 1) give 2×1 − (−2)×1 = 4, which matches the z part of the result (0, 0, 4).
Games and graphics use this a lot. To find out whether a point P is to the left or right of a line AB, work out this number for (B − A) and (P − A). When y grows upward, positive means left and negative means right. When y grows downward, as in screen coordinates, it is the other way around.
8. Side by side with the dot product
Dot product a · b | Cross product a × b | |
|---|---|---|
| What you get | One number | One vector |
| Formula | a1b1 + a2b2 + a3b3 | (a2b3 − a3b2, a3b1 − a1b3, a1b2 − a2b1) |
| Using the angle | ‖a‖ ‖b‖ cos θ | Length is ‖a‖ ‖b‖ sin θ |
| When it is 0 | At a right angle | Parallel |
| Swap the order | Same: a · b = b · a | Flipped: a × b = −(b × a) |
| Where it works | Any number of dimensions | 3D |
| What it tells you | How much the two point the same way | The direction at right angles to both, and the area they make |
With the example above, a · b = 1 and a × b = (−3, −1, 4). The same two vectors give a number one way and an arrow the other way.
Where is it used?
- The direction straight out of a surface (the normal). If a triangle has corners P, Q and R, then
(Q − P) × (R − P)is an arrow standing straight out of that surface. 3D graphics takes the dot product of this arrow and the direction the light comes from to decide how bright the surface is. - The front and back of a surface. The order you list the corners in (P → Q → R or P → R → Q) decides which side of the surface the cross product points to. So programs can tell the front from the back, and skip drawing surfaces that face away from the camera to save time.
- Torque (turning force). When you turn a bolt with a wrench, take the arrow r from the bolt to your hand and the push F. The cross product
r × Fis the torque. It is bigger when your hand is farther away and when you push at a right angle to the wrench. Its direction is the axis the bolt turns around. - Area of a triangle.
‖(Q − P) × (R − P)‖ ÷ 2, because a triangle is half of the parallelogram. For example, with P = (0, 0, 0), Q = (4, 0, 0) and R = (0, 3, 0), the cross product is (0, 0, 12), so the area is 12 ÷ 2 = 6.
Common questions
What is the cross product?
It takes two 3D vectors and makes one new vector. The new vector is at right angles to both of them. Its length is the area of the parallelogram the two vectors make. The right-hand rule decides which way it points.
How is the cross product different from the dot product?
The dot product gives one number. The cross product gives one vector. The dot product is 0 when the two vectors are at right angles. The cross product is 0 when they are parallel. The dot product stays the same if you swap the order. The cross product turns to face the opposite way.
Is there a cross product for 2D vectors?
The cross product works on 3D vectors. If you give two 2D vectors a z of 0 and take the cross product, only one number is left, in the z part (a1b2 − a2b1). This number is the same as a 2×2 determinant. It is the area of the parallelogram the two vectors make, with a plus or minus sign.
What happens if I use my left hand?
The formula stays the same. The right-hand rule comes from an agreement to set up the x, y and z axes the right-handed way. In programs that set up the axes the left-handed way (for example Unity), the result of the same formula looks like it follows a left-hand rule on screen.
When you cross three vectors in a row, does the grouping matter?
Yes. (a × b) × c and a × (b × c) are usually different. For example, with i = (1, 0, 0) and j = (0, 1, 0), (i × i) × j is 0, but i × (i × j) is −j.
Words
| Word used here | Word used in textbooks |
|---|---|
| cross product | cross product, vector product. Written a × b |
| dot product | dot product, scalar product. Written a · b |
| x, y, z parts | components. a1, a2, a3 |
| length | magnitude, norm. Written ‖a‖ |
| at a right angle | perpendicular, orthogonal |
| pointing along one line | parallel |
| arrow standing straight out of a surface | normal vector |
| swapping the order flips it | anticommutativity |
| can be split up | distributive law |
| can be regrouped | associative law. The cross product does not have it |
| right-hand rule | right-hand rule |
| axes set up the right-handed way | right-handed coordinate system |
| turning force | torque |
| axis arrows of length 1: i, j, k | unit vectors, standard basis |