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.

a = (x, y, z)

x

y

z

b = (x, y, z)

x

y

z

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.

𝐚×𝐛=(a2b3−a3b2,a3b1−a1b3,a1b2−a2b1)

𝐚×𝐛=|𝐢𝐣𝐤a1a2a3b1b2b3|=|a2a3b2b3|𝐢−|a1a3b1b3|𝐣+|a1a2b1b2|𝐤

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.

‖𝐚×𝐛‖=‖𝐚‖‖𝐛‖sinθ

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).

𝐚·(𝐚×𝐛)=0,𝐛·(𝐚×𝐛)=0

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.

S=‖𝐚×𝐛‖

S=|det[a1b1a2b2]|=|a1b2−a2b1|(a3=b3=0)

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.

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.

𝐚×𝐛=(a2b3−a3b2,a3b1−a1b3,a1b2−a2b1)

Part you wantNumbers usedFormula
x (first)2, 3a2b3 − a3b2
y (second)3, 1a3b1 − a1b3
z (third)1, 2a1b2 − 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.

S=(a1+b1)(a2+b2)−a1a2−b1b2−2a2b1

=(a1a2+a1b2+a2b1+b1b2)−a1a2−b1b2−2a2b1

=a1b2−a2b1=|a1b1a2b2|

S=5·4−3−6−4=7=3·3−1·2

(3,1,0)×(2,3,0)=(0,0,3·3−1·2)=(0,0,7)

  1. 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.
  2. 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.
  3. 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.
  4. 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.
  5. 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.
  6. 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.

StepWorkingValue
① x parta2b3 − a3b2 = (−2)×1 − 1×1 = −2 − 1−3
② y parta3b1 − a1b3 = 1×1 − 2×1 = 1 − 2−1
③ z parta1b2 − a2b1 = 2×1 − (−2)×1 = 2 + 24
④ Answera × b(−3, −1, 4)
⑤ At a right angle to a?a · (a × b) = 2×(−3) + (−2)×(−1) + 1×4 = −6 + 2 + 40
⑥ At a right angle to b?b · (a × b) = 1×(−3) + 1×(−1) + 1×4 = −3 − 1 + 40
⑦ Length (area)√((−3)² + (−1)² + 4²) = √26about 5.10

Written as equations, the same work looks like this.

𝐚×𝐛=|𝐢𝐣𝐤2−21111|=|−2111|𝐢−|2111|𝐣+|2−211|𝐤

=(−2−1)𝐢−(2−1)𝐣+(2+2)𝐤=(−3,−1,4)

𝐚·(𝐚×𝐛)=−6+2+4=0,𝐛·(𝐚×𝐛)=−3−1+4=0

‖𝐚×𝐛‖=(−3)2+(−1)2+42=26≈5.10

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.

a b a × b (thumb) curl
a × b. Curl from a toward b and your thumb points up.
a b b × a (thumb) curl
b × a. Swap the order and curl from b toward a. Your thumb points down. Same length, opposite direction.

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

PropertyFormulaWhat it means
Swapping the order flips ita × b = −(b × a)Same length, opposite direction. The order matters.
Parallel gives 0a × a = 0If 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 botha · (a × b) = 0, b · (a × b) = 0A 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 × cMake 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 · bCross product a × b
What you getOne numberOne vector
Formulaa1b1 + a2b2 + a3b3(a2b3 − a3b2, a3b1 − a1b3, a1b2 − a2b1)
Using the angle‖a‖ ‖b‖ cos θLength is ‖a‖ ‖b‖ sin θ
When it is 0At a right angleParallel
Swap the orderSame: a · b = b · aFlipped: a × b = −(b × a)
Where it worksAny number of dimensions3D
What it tells youHow much the two point the same wayThe 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?

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 hereWord used in textbooks
cross productcross product, vector product. Written a × b
dot productdot product, scalar product. Written a · b
x, y, z partscomponents. a1, a2, a3
lengthmagnitude, norm. Written ‖a‖
at a right angleperpendicular, orthogonal
pointing along one lineparallel
arrow standing straight out of a surfacenormal vector
swapping the order flips itanticommutativity
can be split updistributive law
can be regroupedassociative law. The cross product does not have it
right-hand ruleright-hand rule
axes set up the right-handed wayright-handed coordinate system
turning forcetorque
axis arrows of length 1: i, j, kunit vectors, standard basis

← Dot productVectors in n dimensions →