Skip to content
8 min read

Cross Product vs Dot Product: When to Use Each

The dot product and cross product are two fundamental operations on vectors that appear throughout mathematics, physics, and engineering. Despite both being called "products", they behave very differently: the dot product returns a scalar while the cross product returns a vector. Understanding when to use each is essential for anyone working with vectors in two or three dimensions.

This guide covers the definitions, formulas, and geometric interpretations of both operations. We include worked examples from physics showing how the dot product calculates work and how the cross product calculates torque.

The Dot Product (Scalar Product)

Definition

The dot product of two vectors a=(a1,a2,a3)\mathbf{a} = (a_1, a_2, a_3) and b=(b1,b2,b3)\mathbf{b} = (b_1, b_2, b_3) is a scalar defined as:

a⋅b=a1b1+a2b2+a3b3\mathbf{a} \cdot \mathbf{b} = a_1 b_1 + a_2 b_2 + a_3 b_3

Equivalently, in terms of magnitudes and the angle θ\theta between the vectors:

a⋅b=∣a∣ ∣b∣cos⁡θ\mathbf{a} \cdot \mathbf{b} = |\mathbf{a}| \, |\mathbf{b}| \cos\theta

Geometric Interpretation

The dot product measures how much one vector "points in the direction" of another. More precisely, it equals the product of the magnitude of one vector and the projection of the other onto it. When θ=0°\theta = 0°, the vectors are parallel and the dot product is maximised. When θ=90°\theta = 90°, the vectors are perpendicular and the dot product is zero.

Key properties of the dot product:

  • The result is always a scalar (a single number).
  • It is commutative: a⋅b=b⋅a\mathbf{a} \cdot \mathbf{b} = \mathbf{b} \cdot \mathbf{a}.
  • It is distributive over addition.
  • a⋅a=∣a∣2\mathbf{a} \cdot \mathbf{a} = |\mathbf{a}|^2, which gives us the magnitude of a vector.
  • Works in any number of dimensions.

Finding the Angle Between Two Vectors

Rearranging the formula lets us find the angle between any two vectors:

cos⁡θ=a⋅b∣a∣ ∣b∣\cos\theta = \frac{\mathbf{a} \cdot \mathbf{b}}{|\mathbf{a}| \, |\mathbf{b}|}

This is one of the most common applications of the dot product in geometry and computer graphics.

The Cross Product (Vector Product)

Definition

The cross product is defined only for three-dimensional vectors. Given a=(a1,a2,a3)\mathbf{a} = (a_1, a_2, a_3) and b=(b1,b2,b3)\mathbf{b} = (b_1, b_2, b_3), the cross product is a vector:

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

Expanding the determinant gives the component form:

a×b=(a2b3−a3b2) i−(a1b3−a3b1) j+(a1b2−a2b1) k\mathbf{a} \times \mathbf{b} = (a_2 b_3 - a_3 b_2)\,\mathbf{i} - (a_1 b_3 - a_3 b_1)\,\mathbf{j} + (a_1 b_2 - a_2 b_1)\,\mathbf{k}

The magnitude of the cross product is:

∣a×b∣=∣a∣ ∣b∣sin⁡θ|\mathbf{a} \times \mathbf{b}| = |\mathbf{a}| \, |\mathbf{b}| \sin\theta

Geometric Interpretation

The cross product produces a vector that is perpendicular to both input vectors. Its magnitude equals the area of the parallelogram formed by the two vectors. When the vectors are parallel (θ=0°\theta = 0° or 180°180°), the cross product is the zero vector. When they are perpendicular (θ=90°\theta = 90°), the cross product has maximum magnitude.

Key properties of the cross product:

  • The result is always a vector.
  • It is anti-commutative: a×b=−(b×a)\mathbf{a} \times \mathbf{b} = -(\mathbf{b} \times \mathbf{a}).
  • It is distributive over addition.
  • It is not associative.
  • Only defined in three dimensions (and seven dimensions, though that is rarely used).

The Right-Hand Rule

The direction of a×b\mathbf{a} \times \mathbf{b} is determined by the right-hand rule. Point the fingers of your right hand along a\mathbf{a}, then curl them towards b\mathbf{b}. Your thumb points in the direction of the cross product. This convention ensures a consistent orientation and is fundamental in physics for defining quantities like angular momentum and the magnetic force on a charged particle.

Dot Product vs Cross Product: Summary

Here is a side-by-side comparison of the two operations:

PropertyDot ProductCross Product
Result typeScalarVector
Formula (trig)∣a∣∣b∣cos⁡θ|\mathbf{a}||\mathbf{b}|\cos\theta∣a∣∣b∣sin⁡θ|\mathbf{a}||\mathbf{b}|\sin\theta
Zero whenPerpendicularParallel
Maximum whenParallelPerpendicular
CommutativityYesNo (anti-commutative)
DimensionsAny3D only

Worked Examples

Example 1: Computing Work (Dot Product)

In physics, work done by a force F\mathbf{F} over a displacement d\mathbf{d} is W=F⋅dW = \mathbf{F} \cdot \mathbf{d}. Suppose a force F=(3,4,0)\mathbf{F} = (3, 4, 0) Newtons acts on an object that moves along d=(5,0,0)\mathbf{d} = (5, 0, 0) metres.

W=F⋅d=3(5)+4(0)+0(0)=15 JW = \mathbf{F} \cdot \mathbf{d} = 3(5) + 4(0) + 0(0) = 15 \text{ J}

Only the component of force along the direction of displacement contributes to work. The vertical component (4 N) does zero work because it is perpendicular to the motion.

Try it yourself

Use our Cross Product Calculator to compute cross products and dot products for any pair of 3D vectors.

Example 2: Computing Torque (Cross Product)

Torque is the rotational analogue of force and is calculated as τ=r×F\boldsymbol{\tau} = \mathbf{r} \times \mathbf{F}, where r\mathbf{r} is the position vector from the pivot to the point where force is applied. Suppose:

r=(2,0,0) m,F=(0,3,0) N\mathbf{r} = (2, 0, 0) \text{ m}, \quad \mathbf{F} = (0, 3, 0) \text{ N}

Computing the cross product:

τ=r×F=∣ijk200030∣\boldsymbol{\tau} = \mathbf{r} \times \mathbf{F} = \begin{vmatrix} \mathbf{i} & \mathbf{j} & \mathbf{k} \\ 2 & 0 & 0 \\ 0 & 3 & 0 \end{vmatrix}
τ=(0⋅0−0⋅3) i−(2⋅0−0⋅0) j+(2⋅3−0⋅0) k=(0,0,6)\boldsymbol{\tau} = (0 \cdot 0 - 0 \cdot 3)\,\mathbf{i} - (2 \cdot 0 - 0 \cdot 0)\,\mathbf{j} + (2 \cdot 3 - 0 \cdot 0)\,\mathbf{k} = (0, 0, 6)

The torque is 6 N\cdotpm6 \text{ N·m} in the k\mathbf{k} direction (pointing out of the plane), confirming the rotation is counter-clockwise when viewed from above. The right-hand rule agrees: fingers point along r\mathbf{r} (positive xx), curl towards F\mathbf{F} (positive yy), and the thumb points in the positive zz direction.

Example 3: Finding the Angle Between Vectors

Find the angle between a=(1,2,3)\mathbf{a} = (1, 2, 3) and b=(4,−1,2)\mathbf{b} = (4, -1, 2).

First, compute the dot product:

a⋅b=1(4)+2(−1)+3(2)=4−2+6=8\mathbf{a} \cdot \mathbf{b} = 1(4) + 2(-1) + 3(2) = 4 - 2 + 6 = 8

Next, find the magnitudes:

∣a∣=12+22+32=14|\mathbf{a}| = \sqrt{1^2 + 2^2 + 3^2} = \sqrt{14}
∣b∣=42+(−1)2+22=21|\mathbf{b}| = \sqrt{4^2 + (-1)^2 + 2^2} = \sqrt{21}

Now apply the angle formula:

cos⁡θ=814⋅21=8294≈817.146≈0.4667\cos\theta = \frac{8}{\sqrt{14} \cdot \sqrt{21}} = \frac{8}{\sqrt{294}} \approx \frac{8}{17.146} \approx 0.4667
θ=cos⁡−1(0.4667)≈62.2°\theta = \cos^{-1}(0.4667) \approx 62.2°

Example 4: Area of a Triangle Using the Cross Product

The area of a triangle with two sides represented by vectors a\mathbf{a} and b\mathbf{b} is half the magnitude of their cross product. Given a=(1,0,3)\mathbf{a} = (1, 0, 3) and b=(2,1,0)\mathbf{b} = (2, 1, 0):

a×b=(0⋅0−3⋅1,  3⋅2−1⋅0,  1⋅1−0⋅2)=(−3,6,1)\mathbf{a} \times \mathbf{b} = (0 \cdot 0 - 3 \cdot 1, \; 3 \cdot 2 - 1 \cdot 0, \; 1 \cdot 1 - 0 \cdot 2) = (-3, 6, 1)
∣a×b∣=(−3)2+62+12=9+36+1=46|\mathbf{a} \times \mathbf{b}| = \sqrt{(-3)^2 + 6^2 + 1^2} = \sqrt{9 + 36 + 1} = \sqrt{46}
Area=1246≈3.39 square units\text{Area} = \frac{1}{2}\sqrt{46} \approx 3.39 \text{ square units}

Try it yourself

Use our Triangle Calculator to compute areas, angles, and side lengths for any triangle.

When to Use Each Product

Use the Dot Product When:

  • You need to find the angle between two vectors.
  • You want to calculate work done by a force.
  • You need to project one vector onto another.
  • You want to test whether two vectors are perpendicular (dot product = 0).
  • You are working in any number of dimensions.

Use the Cross Product When:

  • You need a vector perpendicular to two given vectors.
  • You want to calculate torque or angular momentum.
  • You need the area of a parallelogram or triangle formed by two vectors.
  • You want to find the normal vector to a surface.
  • You are working specifically in three dimensions.

Applications in Physics

Electromagnetic force: The Lorentz force on a charged particle moving through a magnetic field is F=q(v×B)\mathbf{F} = q(\mathbf{v} \times \mathbf{B}), a cross product. The force is always perpendicular to both the velocity and the magnetic field, which is why charged particles follow curved paths.

Work and energy: As shown in Example 1, work is a dot product: W=F⋅dW = \mathbf{F} \cdot \mathbf{d}. Only the component of force along the displacement does work. A force perpendicular to motion does zero work (like the normal force on a sliding block).

Angular momentum: Defined as L=r×p\mathbf{L} = \mathbf{r} \times \mathbf{p}, where p\mathbf{p} is linear momentum. The cross product ensures angular momentum is a vector perpendicular to the plane of rotation.

Frequently Asked Questions

Can you take the cross product in two dimensions?

Strictly, the cross product is defined only in three dimensions. However, for 2D vectors a=(a1,a2)\mathbf{a} = (a_1, a_2) and b=(b1,b2)\mathbf{b} = (b_1, b_2), you can compute a "scalar cross product": a1b2−a2b1a_1 b_2 - a_2 b_1, which gives the signed area of the parallelogram. This is equivalent to treating the 2D vectors as 3D vectors with a zero zz-component and reading off the zz-component of the result.

What does it mean when the dot product is negative?

A negative dot product means the angle between the vectors is greater than 90 degrees. The vectors point in generally opposite directions. When the dot product is exactly zero, the vectors are perpendicular.

Why is the cross product anti-commutative?

Swapping the order of the vectors reverses the direction of the resulting perpendicular vector. By the right-hand rule, a×b\mathbf{a} \times \mathbf{b} points in the opposite direction to b×a\mathbf{b} \times \mathbf{a}. This is physically meaningful: torque applied clockwise is opposite to torque applied counter-clockwise.

How do you remember the cross product formula?

The determinant method is the most reliable. Write the unit vectors i,j,k\mathbf{i}, \mathbf{j}, \mathbf{k} in the first row, the components of the first vector in the second row, and the components of the second vector in the third row. Expand the determinant along the first row using cofactors. With practice, this becomes second nature.

Can you use both products together?

Yes. The scalar triple product a⋅(b×c)\mathbf{a} \cdot (\mathbf{b} \times \mathbf{c}) combines both. It gives the signed volume of the parallelepiped formed by three vectors. The vector triple product a×(b×c)\mathbf{a} \times (\mathbf{b} \times \mathbf{c}) produces a vector that lies in the plane spanned by b\mathbf{b} and c\mathbf{c}.

Try it yourself

Compute cross products instantly with our Cross Product Calculator, or explore triangle geometry with the Triangle Calculator.

Related Articles