How Math Works
Geometryformulaadvanced

Dot & Cross Products

The dot product is 'how aligned?' (a number); the cross product is 'perpendicular to what?' (a vector).

The formula

a·b = a₁b₁ + a₂b₂ + a₃b₃ = |a||b|cosθ; |a×b| = |a||b|sinθ

How to read it: The dot product measures as a number how aligned two vectors are; the cross product builds a new vector perpendicular to both

a·b
Dot product — the result is a number (scalar), 'how aligned?'
a×b
Cross product — the result is a vector, 'the direction perpendicular to both'
θ
The angle between the two vectors

The hook

There are two ways to multiply vectors — one asks 'how much do they point the same way?' (the dot product), the other asks 'what direction is perpendicular to both?' (the cross product).

In plain words

The dot product a·b is a single number measuring how aligned two vectors are. The cross product a×b is a new vector standing perpendicular to the plane the two vectors span.

The intuition

Dot product: like the length of the shadow that a flashlight (a) casts along a wall (direction b) — large when aligned, 0 at a right angle, negative when opposed. Cross product: like the axle that rises perpendicular when you push a door — an arrow poking straight out of the plane of a and b, with length equal to the parallelogram area the two vectors span.

How it's built

The dot product multiplies matching components and adds: a₁b₁+a₂b₂+a₃b₃, which equals |a||b|cosθ — the cosine captures 'alignment'. The cross product's magnitude is |a||b|sinθ, capturing the 'perpendicular part', and its direction follows the right-hand rule (curl your right fingers from a to b, thumb points along a×b).

Example

For a=(1,0,0), b=(0,1,0): a·b = 1·0+0·1+0·0 = 0 (perpendicular, so 0). The cross product is (0,0,1) — the z-axis, perpendicular to both x and y, with magnitude |a||b|sin90°=1. A 2-D dot example: (3,4)·(2,1) = 6+4 = 10.

Common mistake

The two are easy to confuse — the dot product's result is a directionless number (scalar), while the cross product's result is an arrow (vector). Also, a dot product of 0 means 'perpendicular', while a cross product of 0 means 'parallel (aligned)'. Note these are opposite conditions.

Where it's used

Dot: work (force · distance), projections and similarity (cosine similarity in search and recommendation), lighting brightness. Cross: torque and angular momentum, normal vectors (surface orientation in 3-D graphics), magnetic force F=qv×B — the backbone of physics and computer graphics.

Where it came from

The idea sprouted from Hamilton's quaternions in the 1800s; Gibbs and Heaviside refined it, splitting off today's separate dot and cross products for vectors.

Prerequisites

Quick check

What is (1,2,3)·(4,0,0)?

  • 4
  • 6
  • 0
  • 9

Practice

Compute the dot product (3,4)·(1,2).

Answer: 11

Solution:
  1. Multiply matching components and add: 3·1 + 4·2
  2. = 3 + 8 = 11

Takeaway: The dot product = sum of componentwise products; the result is one number.

Compute the dot product (2,0,0)·(0,5,0). What does the result mean geometrically?

Answer: 0

Solution:
  1. 2·0 + 0·5 + 0·0 = 0
  2. A dot product of 0 → the two vectors are perpendicular

Takeaway: Dot product 0 = perpendicular. The x-axis and y-axis are at right angles, so their dot product is 0.

For |a|=2, |b|=3 at a right angle (θ=90°), find the cross-product magnitude |a×b|.

Answer: 6

Solution:
  1. |a×b| = |a||b|sinθ = 2·3·sin90°
  2. sin90°=1 → 2·3·1 = 6

Takeaway: The cross-product magnitude = the area of the parallelogram the two vectors span.

Explain using cosθ and sinθ why a dot product of 0 means 'perpendicular' but a cross product of 0 means 'parallel'.

Answer: undefined

Solution:
  1. Dot = |a||b|cosθ; at θ=90°, cos90°=0 → dot is 0 (perpendicular)
  2. Cross magnitude = |a||b|sinθ; at θ=0°, sin0°=0 → cross is 0 (parallel)
  3. Cosine measures 'alignment', sine measures 'spread' — opposite conditions

Takeaway: Dot uses cos (alignment), cross uses sin (perpendicular part) — the zero conditions are opposite.

Keep learning in the app

Touch-and-drag widgets, self-graded practice and daily formulas — free on iOS and Android.