Professor Turing

Study guides

What is a dot product?

Last updated: 2026-11-26

The dot product multiplies two vectors with the same number of entries, entry by entry, and adds the results. The answer is a single number. Geometrically it equals the length of one vector times the length of the other times the cosine of the angle between them, so it measures how far the two point in a shared direction, weighted by their lengths.

Start learning No account needed

1. Two formulas for one number

In components, a · b = a1 b1 + a2 b2 + … + an bn. In geometry, for two nonzero vectors with angle θ between them, a · b = |a| |b| cos θ. The first is how you compute it. The second tells you what the sign means: positive for an angle under 90 degrees, zero at 90 degrees and negative for an angle over 90 degrees. A vector dotted with itself gives its length squared, which for a nonzero vector matches the cosine formula at an angle of 0.

2. A worked example: angle, projection and work

Take a = (3, 4), b = (8, 6) and c = (30, 0). Predict whether b or c has the larger dot product with a, and which points closer to a. The numbers come from scripts/what-is-a-dot-product-worked-example.py in the Professor Turing repository.

a = (3, 4), b = (8, 6), c = (30, 0)
a . b = 3*8 + 4*6 = 48
lengths: a = 5, b = 10, c = 30
a and b: cosine = 0.96, angle = 16.26 degrees
a . c = 90
a and c: cosine = 0.60, angle = 53.13 degrees
projection of b onto a = 1.92 * a = (5.76, 7.68), length 9.6
b minus projection = (2.24, -1.68), dot with a = 0.00
work for a displacement of (3, 4) metres:
  force (8, 6) newtons: 48 joules
  force (-4, 3) newtons: 0 joules
  force (-8, -6) newtons: -48 joules
p = (1, 1), q = (1, -1)
  dot product: 0
  weighted product 2*p1*q1 + p2*q2: 1

From a · b = 48 and lengths 5 and 10, the cosine is 48 / 50 = 0.96, and the angle is about 16.26 degrees.

3. Projection: the shadow of b along a

The projection of b onto a is ((a · b) / (a · a)) a. Here that is 48 / 25 times a, or (5.76, 7.68), with length 9.6. What is left over, b minus the projection, has dot product 0 with a, so it is perpendicular. You have split b into a part along a and a part at right angles to it.

4. One physics use: work

For a constant force F and a straight displacement d, the work done is F · d. Only the part of the force along the motion counts. In the output, over the displacement (3, 4), the force (8, 6) does 48 joules, the force (−4, 3) is at right angles to the displacement and does 0, and the force (−8, −6) does −48.

5. A common misconception: a bigger dot product means better aligned

c has the larger dot product with a, 90 against 48, yet it sits at 53.13 degrees from a, while b sits at 16.26 degrees. c wins on length. To compare directions alone, divide by both lengths and compare the cosines: 0.60 for c and 0.96 for b.

6. Dot product and inner product

An inner product is a generalization of the dot product: a rule that takes two vectors to a scalar and obeys a short list of properties. The dot product is the standard example for ordinary coordinate vectors. Continuous functions on a closed interval have an inner product too, built from an integral.

Different inner products can disagree about which vectors are perpendicular, or orthogonal. The rule 2 p1 q1 + p2 q2 is also an inner product on the plane. With p = (1, 1) and q = (1, −1), the dot product is 0 but this weighted product is 1. Some books, including Hefferon's, also use "inner product" as another name for the dot product, so check how your course defines it.

7. Test yourself

Case 1. Compute (1, 2, 3) · (4, −5, 2) and say what it shows.

Answer to case 1

4 − 10 + 6 = 0. The vectors are nonzero, so they are perpendicular.

Case 2. Find the angle between (1, 0) and (1, 1) using the dot product.

Answer to case 2

The cosine is 1 divided by the square root of 2, so the angle is 45 degrees.

Case 3. Project (2, 3) onto (5, 0).

Answer to case 3

The dot products are 10 and 25, so the projection is 10 / 25 times (5, 0), which is (2, 0).

To practice from memory, see how to test yourself. For exam preparation, see how to study for a physics exam. A basis of a space does not require perpendicular vectors; see span and basis.

What the sources found, and their limits

Dan Margalit and Joseph Rabinoff, Interactive Linear Algebra, section 6.1. It defines the dot product, length and orthogonality for vectors with n entries. License: GNU Free Documentation License. Source: Dot products and orthogonality, read on 2026-11-25.

Wikipedia, "Dot product." The component and cosine formulas, orthogonal vectors, scalar and vector projection, and work as force dotted with displacement. License: CC BY-SA 4.0. Source: Dot product, read on 2026-11-25.

Wikipedia, "Inner product space." Inner products as a generalization of the dot product, their properties, an integral inner product for continuous functions and the weighted version with positive weights. License: CC BY-SA 4.0. Source: Inner product space, read on 2026-11-25.

Jim Hefferon, Linear Algebra, fourth edition, chapter one, section II.2. It defines the dot product and gives inner product and scalar product as other names for it. License: GNU Free Documentation License or CC BY-SA 2.5. Source: Linear Algebra (PDF), read on 2026-11-25.

Limits: selected passages of a textbook, a second textbook and reference articles, and this page treats real vectors. The weights 2 and 1, the numbers and the self-test cases are ours.

How Professor Turing helps

Professor Turing is a tutor for adults learning any subject, in college or on their own. It asks you questions instead of giving the final answer, does not grade a bare guess, and remembers what you got wrong. No account is needed to start. It's an AI tutor, free to try.

Bring two vectors and say what you think their dot product tells you. Its first reply asks what you already know, such as what the sign says about the angle, before it teaches anything. You must be 18 or older, and guest conversations are deleted 7 days after the last activity.

FAQ

What does a negative dot product mean? The angle between the two nonzero vectors is more than 90 degrees. In the work example, it means the force acts against the motion.

What is the difference between a dot product and an inner product? The dot product is one inner product, the standard one for ordinary coordinate vectors. An inner product is any rule on a vector space that has the required properties, so there can be others. Some books use the two names for the same thing, so check yours.

Start with what you're working on

Tell the tutor which vector problem you are working on and let it ask you the questions.

Start learning No account needed

See also: what is a vector space · all study guides