• Foundation
  • About 15 min
  • 5 practice questions

The dot product from first principles: meaning, the sign of the angle and first uses

Understand the dot product as a number that measures how much two vectors point the same way, compute it in components, use its sign to classify the angle, and test for perpendicular vectors.

If something looks wrong, please tell us.

So far we have added vectors and multiplied them by numbers. There is also a way of multiplying two vectors to obtain a number. It is called the dot product (or scalar product), and it answers the question 'how much do these two vectors point in the same direction?' Everything about angles between vectors, and about perpendicular lines, starts from it.

The idea

Draw two vectors a and b from the same point, with angle θ between them, where 0° ≤ θ ≤ 180°. The dot product is defined as a · b = |a| |b| cos θ. The answer is a single number, not a vector. Think of |b| cos θ as the length of b in the direction of a. Then a · b is |a| times that length. If the vectors point the same way, cos θ = 1 and the product is as large as it can be. If they are at right angles, cos θ = 0 and the product is zero. If they point against each other, cos θ is negative.

Angle between a and bcos θa · b
Acute (less than 90°)PositivePositive
Right angle (90°)ZeroZero
Obtuse (more than 90°)NegativeNegative

In components

The unit vectors satisfy i · i = j · j = 1, because the angle is 0° and the magnitudes are 1, and i · j = 0, because the angle is 90°. Multiplying out the brackets, for a = a₁i + a₂j and b = b₁i + b₂j, all the mixed terms vanish and we are left with a · b = a₁b₁ + a₂b₂. In three dimensions, add a₃b₃. In particular a · a = a₁² + a₂² = |a|², so |a| = √(a · a). The product does not depend on the order: a · b = b · a.

a · b = |a||b| cos θ = a₁b₁ + a₂b₂ (+ a₃b₃). Positive means acute, zero means perpendicular, negative means obtuse. a · a = |a|².

Worked example 1: a number and an angle

Let a = 3i + 4j and b = 2i − j. Then a · b = 3 × 2 + 4 × (−1) = 2, which is positive, so the angle is acute. The magnitudes are |a| = 5 and |b| = √5, so cos θ = 2/(5√5).

Worked example 2: perpendicular vectors

Show that 2i + 3j and 3i − 2j are perpendicular. The dot product is 2 × 3 + 3 × (−2) = 6 − 6 = 0, so they are perpendicular. This is a pattern: to make a vector perpendicular to xi + yj in the plane, swap the components and change one sign, giving −yi + xj or yi − xj.

Worked example 3: the same magnitudes, different angles

Let |a| = 3 and |b| = 4. If the angle is 60°, a · b = 12 cos 60° = 6. If the angle is 120°, a · b = 12 cos 120° = −6. If the angle is 90°, the product is 0. Finally a · a = |a|² = 9, because the angle between a vector and itself is 0°.

Worked example 4: a right-angled triangle

Show that the triangle with vertices A(1, 1), B(4, 2) and C(0, 4) has a right angle at A. Then AB = (3, 1) and AC = (−1, 3). The dot product is 3 × (−1) + 1 × 3 = 0, so AB ⊥ AC. Both |AB|² = 9 + 1 = 10 and |AC|² = 1 + 9 = 10, so the triangle is also isosceles.

Common mistakes

  • Writing a · b as a vector. It is a number.
  • Forgetting the minus signs in the components.
  • Taking the angle at a vertex between AB and BC instead of between BA and BC.
  • Thinking a · b = 0 means a = 0 or b = 0. Perpendicular non-zero vectors also give 0.

Key takeaways. The dot product is |a||b| cos θ, or the sum of the products of matching components. Its sign tells you whether the angle is acute, right or obtuse. Zero means perpendicular, and a · a = |a|².

Check your understanding

  1. 1. What is (2i − 3j) · (4i + j)?

    1. 5
    2. −5
    3. 11
    4. 14
    Show answer

    Answer: A. Multiply matching components and add: 2 × 4 + (−3) × 1 = 8 − 3 = 5.

  2. 2. If a · b < 0 for two non-zero vectors, what can you say about the angle between them?

    1. It is acute
    2. It is a right angle
    3. It is obtuse
    4. It is zero
    Show answer

    Answer: C. Since |a| and |b| are positive, the sign of a · b is the sign of cos θ. A negative cosine means an angle between 90° and 180°.

  3. 3. For what value of k are ki + 3j and 2i − 6j perpendicular?

    1. −9
    2. 9
    3. 1
    4. 3
    Show answer

    Answer: B. The dot product must be zero: 2k − 18 = 0, so k = 9.

  4. 4. |a| = 5, |b| = 2 and the angle between them is 120°. What is a · b?

    1. 5
    2. −5√3
    3. 5√3
    4. −5
    Show answer

    Answer: D. a · b = 5 × 2 × cos 120° = 10 × (−1/2) = −5.

  5. 5. What is a · a for a = 3i − 4j?

    1. 5
    2. 25
    3. 7
    4. −7
    Show answer

    Answer: B. a · a = 3² + (−4)² = 9 + 16 = 25, which equals |a|². The value 5 is the magnitude |a|.

Privacy · Terms · Refunds · Delivery