← Back to calculus 3

Cross Product

Dot product vs cross product

Both products combine two vectors, but they produce very different outputs.

Dot product ab\vec{a}\cdot\vec{b}Cross product a×b\vec{a}\times\vec{b}
Outputscalarvector
Dimensionany Rn\mathbb{R}^nonly R3\mathbb{R}^3
Key trigabcosθ\|\vec{a}\|\|\vec{b}\|\cos\thetaabsinθ\|\vec{a}\|\|\vec{b}\|\sin\theta
Zero whenperpendicular (θ=90°\theta=90°)parallel (θ=0°\theta=0° or 180°180°)

The dot product measures how much two vectors align; the cross product measures how much they span — the result is a new vector perpendicular to both.


A geometric question

Given two non-parallel vectors a\vec{a} and b\vec{b} in R3\mathbb{R}^3, how do we find a vector n\vec{n} that is perpendicular to both?

That is, we want n0\vec{n} \neq \vec{0} satisfying

na=0andnb=0.\vec{n}\cdot\vec{a}=0 \quad\text{and}\quad \vec{n}\cdot\vec{b}=0.

Writing n=(n1,n2,n3)\vec{n}=(n_1,n_2,n_3) and expanding both conditions gives a 2×32\times 3 homogeneous linear system. Because there are more unknowns than equations, a non-trivial solution always exists — but the system doesn't give a clean formula. The cross product provides exactly such a formula.

The graph below shows two 3D vectors and their cross product. Notice how a×b\vec{a}\times\vec{b} (red) stands perpendicular to the blue-green parallelogram.

a × b is perpendicular to both a and b

a⃗ =(,,)
b⃗ =(,,)
a⃗ × b⃗ = (1, -2, 4)|a⃗ × b⃗| = 4.58θ = 66.42°Area of ▱ = 4.58

Drag to rotate · Scroll to zoom · Edit the inputs above to change the vectors.


Definition of cross product

For a=(a1,a2,a3)\vec{a}=(a_1,a_2,a_3) and b=(b1,b2,b3)\vec{b}=(b_1,b_2,b_3), the cross product is defined by the symbolic 3×33\times 3 determinant

a×b=ijka1a2a3b1b2b3,\vec{a}\times\vec{b} = \begin{vmatrix} \vec{i} & \vec{j} & \vec{k} \\ a_1 & a_2 & a_3 \\ b_1 & b_2 & b_3 \end{vmatrix},

where i=(1,0,0)\vec{i}=(1,0,0), j=(0,1,0)\vec{j}=(0,1,0), k=(0,0,1)\vec{k}=(0,0,1) are the standard basis vectors.

Expanding the determinant

We expand along the top row (cofactor expansion):

a×b=ia2a3b2b3ja1a3b1b3+ka1a2b1b2.\vec{a}\times\vec{b} = \vec{i}\begin{vmatrix}a_2&a_3\\b_2&b_3\end{vmatrix} - \vec{j}\begin{vmatrix}a_1&a_3\\b_1&b_3\end{vmatrix} + \vec{k}\begin{vmatrix}a_1&a_2\\b_1&b_2\end{vmatrix}.

Computing each 2×22\times 2 determinant:

a×b=(a2b3a3b2)i(a1b3a3b1)j+(a1b2a2b1)k.\vec{a}\times\vec{b} = (a_2b_3-a_3b_2)\,\vec{i} -(a_1b_3-a_3b_1)\,\vec{j} +(a_1b_2-a_2b_1)\,\vec{k}.

In component form:

a×b=(a2b3a3b2,  a3b1a1b3,  a1b2a2b1).\boxed{ \vec{a}\times\vec{b} = \bigl(a_2b_3-a_3b_2,\; a_3b_1-a_1b_3,\; a_1b_2-a_2b_1\bigr). }

A worked example

Compute (1,2,1)×(3,0,2)(1,2,-1)\times(3,0,2).

Step 1. Write the determinant:

ijk121302\begin{vmatrix} \vec{i}&\vec{j}&\vec{k}\\ 1&2&-1\\ 3&0&2 \end{vmatrix}

Step 2. Expand:

i2102j1132+k1230\vec{i}\begin{vmatrix}2&-1\\0&2\end{vmatrix} -\vec{j}\begin{vmatrix}1&-1\\3&2\end{vmatrix} +\vec{k}\begin{vmatrix}1&2\\3&0\end{vmatrix} =i(40)j(2(3))+k(06)=4i5j6k.=\vec{i}(4-0)-\vec{j}(2-(-3))+\vec{k}(0-6) =4\vec{i}-5\vec{j}-6\vec{k}.

So (1,2,1)×(3,0,2)=(4,5,6)(1,2,-1)\times(3,0,2)=(4,-5,-6).

Compute (1,0,0)×(0,1,0)(1,0,0)\times(0,1,0).

Answer:

ijk100010=i(0001)j(1000)+k(1100)=(0,0,1).\begin{vmatrix}\vec{i}&\vec{j}&\vec{k}\\1&0&0\\0&1&0\end{vmatrix} =\vec{i}(0\cdot0-0\cdot1)-\vec{j}(1\cdot0-0\cdot0)+\vec{k}(1\cdot1-0\cdot0) =(0,0,1).

This is expected: i×j=k\vec{i}\times\vec{j}=\vec{k}.

ijk213120\begin{vmatrix}\vec{i}&\vec{j}&\vec{k}\\2&-1&3\\1&2&0\end{vmatrix}=i((1)(0)(3)(2))j((2)(0)(3)(1))+k((2)(2)(1)(1))=\vec{i}((-1)(0)-(3)(2))-\vec{j}((2)(0)-(3)(1))+\vec{k}((2)(2)-(-1)(1))=i(6)j(3)+k(5)=(6,3,5).=\vec{i}(-6)-\vec{j}(-3)+\vec{k}(5) =(-6,3,5).

Find kk such that (k,1,1)×(2,0,1)(k,1,-1)\times(2,0,1) has zz-component equal to 2-2.

Answer:

The zz-component of the cross product is

k012=2.k\cdot0-1\cdot2 = -2.

This gives 2=2-2=-2, which is satisfied for all kk. So any kk works — the zz-component is always 2-2 regardless of kk.

(The zz-component only involves the first two rows' k\vec{k} minor: kz=a1b2a2b1=k012=2k_z=a_1b_2-a_2b_1=k\cdot0-1\cdot2=-2.)


Key algebraic properties

a×a=0\vec{a}\times\vec{a}=\vec{0}

A determinant with two identical rows equals zero:

a×a=ijka1a2a3a1a2a3=0.\vec{a}\times\vec{a} = \begin{vmatrix}\vec{i}&\vec{j}&\vec{k}\\a_1&a_2&a_3\\a_1&a_2&a_3\end{vmatrix}=\vec{0}.

Parallel vectors: a×b=0\vec{a}\times\vec{b}=\vec{0}

If b=ka\vec{b}=k\vec{a} for some scalar kk, then rows 2 and 3 of the determinant are proportional, so the determinant is zero:

a×(ka)=k(a×a)=0.\vec{a}\times(k\vec{a})=k(\vec{a}\times\vec{a})=\vec{0}.

More generally, a×b=0\vec{a}\times\vec{b}=\vec{0} if and only if a\vec{a} and b\vec{b} are parallel (or at least one is 0\vec{0}).

Perpendicularity: (a×b)a=0(\vec{a}\times\vec{b})\cdot\vec{a}=0 and (a×b)b=0(\vec{a}\times\vec{b})\cdot\vec{b}=0

Let n=a×b\vec{n}=\vec{a}\times\vec{b}. Then

na=a1a2a3a1a2a3b1b2b3=0,\vec{n}\cdot\vec{a} = \begin{vmatrix}a_1&a_2&a_3\\a_1&a_2&a_3\\b_1&b_2&b_3\end{vmatrix}=0,

because the first two rows are identical. Similarly,

nb=b1b2b3a1a2a3b1b2b3=0.\vec{n}\cdot\vec{b} = \begin{vmatrix}b_1&b_2&b_3\\a_1&a_2&a_3\\b_1&b_2&b_3\end{vmatrix}=0.

Answer to the geometric question: n=a×b\vec{n}=\vec{a}\times\vec{b} is always perpendicular to both a\vec{a} and b\vec{b}.

Compute the cross product and check both dot products.

Step 1. a×b\vec{a}\times\vec{b}:

(341(1),  1124,  2(1)31)=(13,7,5).(3\cdot4-1\cdot(-1),\;1\cdot1-2\cdot4,\;2\cdot(-1)-3\cdot1) =(13,-7,-5).

Step 2. (13,7,5)(2,3,1)=26215=0(13,-7,-5)\cdot(2,3,1)=26-21-5=0. ✓

Step 3. (13,7,5)(1,1,4)=13+720=0(13,-7,-5)\cdot(1,-1,4)=13+7-20=0. ✓

Show (1,2,3)×(2,4,6)=0(1,2,3)\times(2,4,6)=\vec{0}.

Answer: (2,4,6)=2(1,2,3)(2,4,6)=2(1,2,3), so the vectors are parallel. By the parallel-vectors property, their cross product is 0\vec{0}.

Direct check: (2634,  3216,  1422)=(0,0,0)(2\cdot6-3\cdot4,\;3\cdot2-1\cdot6,\;1\cdot4-2\cdot2)=(0,0,0). ✓


Magnitude: the sine formula

Theorem. For vectors a,b\vec{a},\vec{b} with angle θ\theta between them,

a×b=absinθ.\|\vec{a}\times\vec{b}\| = \|\vec{a}\|\,\|\vec{b}\|\sin\theta.

Geometric meaning: area of the parallelogram

The parallelogram spanned by a\vec{a} and b\vec{b} has base b\|\vec{b}\| and height h=asinθh=\|\vec{a}\|\sin\theta.

Area=base×height=basinθ=a×b.\text{Area} = \text{base}\times\text{height} = \|\vec{b}\|\cdot\|\vec{a}\|\sin\theta = \|\vec{a}\times\vec{b}\|.

Drag the vectors below to see the parallelogram, the dashed height h=asinθh=|\vec{a}|\sin\theta, and the real-time area.

Area of parallelogram = |a × b| = |a||b|sin θ

a⃗ = (4.00, 1.00)b⃗ = (1.00, 3.00)a⃗ · b⃗ = 7.000θ = 57.5°a⃗ × b⃗ = 11.000Area = |a⃗ × b⃗| = 11.000h = |a⃗|sin θ = 3.479

Drag the coloured dots at the arrow tips to move each vector.

-8-7-6-5-4-3-2-112345678-6-5-4-3-2-1123456a⃗+b⃗hθa⃗b⃗O

We want to show a×b2=a2b2sin2θ\|\vec{a}\times\vec{b}\|^2=\|\vec{a}\|^2\|\vec{b}\|^2\sin^2\theta.

Using sin2θ=1cos2θ\sin^2\theta=1-\cos^2\theta and cosθ=abab\cos\theta=\frac{\vec{a}\cdot\vec{b}}{\|\vec{a}\|\|\vec{b}\|}:

a2b2sin2θ=a2b2(ab)2.\|\vec{a}\|^2\|\vec{b}\|^2\sin^2\theta =\|\vec{a}\|^2\|\vec{b}\|^2-(\vec{a}\cdot\vec{b})^2.

Write a×b2=(a2b3a3b2)2+(a3b1a1b3)2+(a1b2a2b1)2\|\vec{a}\times\vec{b}\|^2=(a_2b_3-a_3b_2)^2+(a_3b_1-a_1b_3)^2+(a_1b_2-a_2b_1)^2 and expand. After expanding both sides and comparing term by term, equality holds. (This is Lagrange's identity.)

Find the area of the triangle with vertices P=(1,0,0)P=(1,0,0), Q=(0,1,0)Q=(0,1,0), R=(0,0,1)R=(0,0,1).

Answer:

Two edge vectors from PP: a=QP=(1,1,0)\vec{a}=Q-P=(-1,1,0) and b=RP=(1,0,1)\vec{b}=R-P=(-1,0,1).

a×b=(1100,  0(1)(1)1,  (1)01(1))=(1,1,1).\vec{a}\times\vec{b}=(1\cdot1-0\cdot0,\;0\cdot(-1)-(-1)\cdot1,\;(-1)\cdot0-1\cdot(-1))=(1,1,1).Area of triangle=12a×b=123.\text{Area of triangle}=\tfrac{1}{2}\|\vec{a}\times\vec{b}\|=\tfrac{1}{2}\sqrt{3}.

Find the area of the parallelogram spanned by a=(3,0,0)\vec{a}=(3,0,0) and b=(1,2,0)\vec{b}=(1,2,0).

Answer:

a×b=(0002,  0130,  3201)=(0,0,6).\vec{a}\times\vec{b}=(0\cdot0-0\cdot2,\;0\cdot1-3\cdot0,\;3\cdot2-0\cdot1)=(0,0,6).

Area =(0,0,6)=6=\|(0,0,6)\|=6.

(Geometrically: base =3=3, height =2=2, area =6=6.)

a=(1,1,0)\vec{a}=(1,1,0) and b=(0,1,0)\vec{b}=(0,1,0).

Compute a×b\|\vec{a}\times\vec{b}\| and ab\|\vec{a}\|\|\vec{b}\|, then find θ\theta.

Answer:

a×b=(0,0,1)\vec{a}\times\vec{b}=(0,0,1), so a×b=1\|\vec{a}\times\vec{b}\|=1.

a=2\|\vec{a}\|=\sqrt{2}, b=1\|\vec{b}\|=1, so sinθ=12\sin\theta=\frac{1}{\sqrt{2}}, giving θ=45°\theta=45°.


Arithmetic properties

Anti-commutativity

a×b=(b×a).\vec{a}\times\vec{b} = -(\vec{b}\times\vec{a}).

Swapping two rows of a determinant negates it, so swapping a\vec{a} and b\vec{b} negates the cross product. The cross product is NOT commutative.

b×a=ijkb1b2b3a1a2a3=ijka1a2a3b1b2b3=(a×b).\vec{b}\times\vec{a} = \begin{vmatrix}\vec{i}&\vec{j}&\vec{k}\\b_1&b_2&b_3\\a_1&a_2&a_3\end{vmatrix} =-\begin{vmatrix}\vec{i}&\vec{j}&\vec{k}\\a_1&a_2&a_3\\b_1&b_2&b_3\end{vmatrix} =-(\vec{a}\times\vec{b}).

Distributivity over addition

a×(b+c)=a×b+a×c.\vec{a}\times(\vec{b}+\vec{c}) = \vec{a}\times\vec{b} + \vec{a}\times\vec{c}. (a+b)×c=a×c+b×c.(\vec{a}+\vec{b})\times\vec{c} = \vec{a}\times\vec{c} + \vec{b}\times\vec{c}.

Scalar compatibility

(ka)×b=k(a×b)=a×(kb).(k\vec{a})\times\vec{b} = k(\vec{a}\times\vec{b}) = \vec{a}\times(k\vec{b}).

Cross product is NOT associative

In general, (a×b)×ca×(b×c)(\vec{a}\times\vec{b})\times\vec{c}\neq\vec{a}\times(\vec{b}\times\vec{c}).

Counterexample. Let a=b=i=(1,0,0)\vec{a}=\vec{b}=\vec{i}=(1,0,0), c=j=(0,1,0)\vec{c}=\vec{j}=(0,1,0):

(i×i)×j=0×j=0,(\vec{i}\times\vec{i})\times\vec{j}=\vec{0}\times\vec{j}=\vec{0}, i×(i×j)=i×k=(0,0,1)×(0,0,1)...\vec{i}\times(\vec{i}\times\vec{j})=\vec{i}\times\vec{k}=(0,0,1)\times(0,0,1)...

Actually: i×j=k\vec{i}\times\vec{j}=\vec{k}, and i×k=(1,0,0)×(0,0,1)=(0100,  0011,  1000)=(0,1,0)=j0\vec{i}\times\vec{k}=(1,0,0)\times(0,0,1)=(0\cdot1-0\cdot0,\;0\cdot0-1\cdot1,\;1\cdot0-0\cdot0)=(0,-1,0)=-\vec{j}\neq\vec{0}.

Compute (1,2,0)×(3,1,0)(1,2,0)\times(3,1,0) and (3,1,0)×(1,2,0)(3,1,0)\times(1,2,0). Check they are negatives of each other.

Answer:

(1,2,0)×(3,1,0)=(2001,  0310,  1123)=(0,0,5)(1,2,0)\times(3,1,0)=(2\cdot0-0\cdot1,\;0\cdot3-1\cdot0,\;1\cdot1-2\cdot3)=(0,0,-5).

(3,1,0)×(1,2,0)=(1002,  0130,  3211)=(0,0,5)(3,1,0)\times(1,2,0)=(1\cdot0-0\cdot2,\;0\cdot1-3\cdot0,\;3\cdot2-1\cdot1)=(0,0,5).

Indeed (0,0,5)=(0,0,5)(0,0,5)=-(0,0,-5). ✓

Simplify (a+b)×(ab)(\vec{a}+\vec{b})\times(\vec{a}-\vec{b}).

Answer:

(a+b)×(ab)=a×aa×b+b×ab×b.(\vec{a}+\vec{b})\times(\vec{a}-\vec{b}) =\vec{a}\times\vec{a}-\vec{a}\times\vec{b}+\vec{b}\times\vec{a}-\vec{b}\times\vec{b}.

Using a×a=0\vec{a}\times\vec{a}=\vec{0}, b×b=0\vec{b}\times\vec{b}=\vec{0}, and b×a=a×b\vec{b}\times\vec{a}=-\vec{a}\times\vec{b}:

=0a×ba×b0=2(a×b).=\vec{0}-\vec{a}\times\vec{b}-\vec{a}\times\vec{b}-\vec{0}=-2(\vec{a}\times\vec{b}).

Given a=(1,0,0)\vec{a}=(1,0,0), b=(0,1,0)\vec{b}=(0,1,0), c=(0,0,1)\vec{c}=(0,0,1), compute

(2ab)×c.(2\vec{a}-\vec{b})\times\vec{c}.

Answer:

(2ab)×c=2(a×c)(b×c).(2\vec{a}-\vec{b})\times\vec{c} =2(\vec{a}\times\vec{c})-(\vec{b}\times\vec{c}).

a×c=(1,0,0)×(0,0,1)=(0100,  0011,  1000)=(0,1,0)=j\vec{a}\times\vec{c}=(1,0,0)\times(0,0,1)=(0\cdot1-0\cdot0,\;0\cdot0-1\cdot1,\;1\cdot0-0\cdot0)=(0,-1,0)=-\vec{j}.

b×c=(0,1,0)×(0,0,1)=(1,0,0)=i\vec{b}\times\vec{c}=(0,1,0)\times(0,0,1)=(1,0,0)=\vec{i}.

So (2ab)×c=2(0,1,0)(1,0,0)=(1,2,0)(2\vec{a}-\vec{b})\times\vec{c}=2(0,-1,0)-(1,0,0)=(-1,-2,0).


Scalar triple product

The scalar triple product of three vectors is

a(b×c).\vec{a}\cdot(\vec{b}\times\vec{c}).

Formula via a 3×33\times3 determinant

a(b×c)=a1a2a3b1b2b3c1c2c3.\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}.

This follows by expanding b×c\vec{b}\times\vec{c} and then dotting with a\vec{a}:

a(b×c)=a1(b2c3b3c2)a2(b1c3b3c1)+a3(b1c2b2c1),\vec{a}\cdot(\vec{b}\times\vec{c}) =a_1(b_2c_3-b_3c_2)-a_2(b_1c_3-b_3c_1)+a_3(b_1c_2-b_2c_1),

which is exactly the cofactor expansion of the 3×33\times3 determinant along row 1.

Geometric meaning: volume of the parallelepiped

The three vectors a,b,c\vec{a},\vec{b},\vec{c} span a parallelepiped (a 3D solid with six parallelogram faces). Its volume is

V=a(b×c).V = \bigl|\vec{a}\cdot(\vec{b}\times\vec{c})\bigr|.

The base parallelogram (spanned by b\vec{b} and c\vec{c}) has area b×c\|\vec{b}\times\vec{c}\|, and the height is the component of a\vec{a} in the direction of b×c\vec{b}\times\vec{c}, which is an^|\vec{a}\cdot\hat{n}| where n^=b×cb×c\hat{n}=\frac{\vec{b}\times\vec{c}}{\|\vec{b}\times\vec{c}\|}.

V=b×ca(b×c)b×c=a(b×c).V = \|\vec{b}\times\vec{c}\|\cdot\frac{|\vec{a}\cdot(\vec{b}\times\vec{c})|}{\|\vec{b}\times\vec{c}\|} = |\vec{a}\cdot(\vec{b}\times\vec{c})|.

Rotate the 3D graph below to see the parallelepiped formed by three vectors. Edit the inputs to change the shape and watch the volume update.

Scalar triple product = signed volume of parallelepiped

a⃗ =(,,)
b⃗ =(,,)
c⃗ =(,,)
b⃗ × c⃗ = (4, 0, -2)a⃗ · (b⃗ × c⃗) = 8Volume = |a⃗ · (b⃗ × c⃗)| = 8

Drag to rotate · Scroll to zoom · Edit the inputs above to change the vectors.

Coplanarity test

The vectors a,b,c\vec{a},\vec{b},\vec{c} are coplanar (all lie in the same plane) if and only if

a(b×c)=0.\vec{a}\cdot(\vec{b}\times\vec{c})=0.

This is because the parallelepiped collapses to a flat shape with zero volume.

Compute a(b×c)\vec{a}\cdot(\vec{b}\times\vec{c}) for a=(1,0,0)\vec{a}=(1,0,0), b=(0,1,0)\vec{b}=(0,1,0), c=(0,0,1)\vec{c}=(0,0,1).

Answer:

100010001=1.\begin{vmatrix}1&0&0\\0&1&0\\0&0&1\end{vmatrix}=1.

The unit cube has volume 1. ✓

Find the volume of the parallelepiped with edge vectors a=(2,0,0)\vec{a}=(2,0,0), b=(0,3,0)\vec{b}=(0,3,0), c=(0,0,4)\vec{c}=(0,0,4).

Answer:

200030004=234=24.\begin{vmatrix}2&0&0\\0&3&0\\0&0&4\end{vmatrix}=2\cdot3\cdot4=24.

Volume =24=24=|24|=24. (A 2×3×42\times3\times4 box.)

Are a=(1,2,3)\vec{a}=(1,2,3), b=(0,1,1)\vec{b}=(0,1,1), c=(2,3,5)\vec{c}=(2,3,5) coplanar?

Answer:

123011235=1(1513)2(0512)+3(0312)=2+46=0.\begin{vmatrix}1&2&3\\0&1&1\\2&3&5\end{vmatrix} =1(1\cdot5-1\cdot3)-2(0\cdot5-1\cdot2)+3(0\cdot3-1\cdot2) =2+4-6=0.

Yes, they are coplanar (the determinant is 0).

Let a=(1,1,0)\vec{a}=(1,1,0), b=(0,1,1)\vec{b}=(0,1,1), c=(1,0,1)\vec{c}=(1,0,1). Find a(b×c)\vec{a}\cdot(\vec{b}\times\vec{c}).

Answer:

110011101=1(1110)1(0111)+0=1+1=2.\begin{vmatrix}1&1&0\\0&1&1\\1&0&1\end{vmatrix} =1(1\cdot1-1\cdot0)-1(0\cdot1-1\cdot1)+0 =1+1=2.

Volume of parallelepiped =2=2=|2|=2.