Sign in to save

Bookmark this page so you can find it later.

Sign in to save

Bookmark this page so you can find it later.

The dot product is a way to multiply two vectors and get a single number called a scalar. It tells how much two vectors point in the same direction, which makes it useful in geometry, physics, computer graphics, and data science. When two vectors line up, the dot product is large and positive, and when they point opposite ways, it is negative.

When they are perpendicular, the dot product is zero.

Understanding Math: The Dot Product

When vectors are written in coordinates, each coordinate describes movement along one chosen axis. Multiply matching coordinates because only movement on the same axis can contribute to their shared direction. A horizontal part has no directional overlap with a vertical part.

Adding the matching products collects the contributions from every axis. For example, a vector with components three and minus two compared with one with components four and five gives twelve plus negative ten, leaving two.

The negative contribution shows that, on that axis, the directions conflict. This coordinate method works even when vectors are drawn far apart, since vectors represent size and direction rather than a fixed location.

The angle form explains why the answer changes smoothly as one vector turns. The cosine of the angle measures the fraction of one vector that lies along the direction of the other. Multiplying by both lengths then accounts for the sizes of the vectors.

A long vector can produce a large result even when its direction is only partly aligned. This idea leads to projection. A projection is the part of one vector that points along a chosen direction.

It is like finding a shadow cast onto a line. Projection is useful because it separates useful motion in one direction from leftover motion sideways. If a vector has zero length, its direction is not defined, so angle and projection calculations that divide by its length cannot be used.

In physics, the dot product explains work. A force contributes work only through the part of the force pointing in the direction an object moves. Pulling a suitcase forward does useful work, while pulling straight upward does not move it forward.

The upward pull may still matter for other reasons, but it has no forward contribution. Engineers use the same idea to find forces pushing into surfaces. In computer graphics, a surface has a perpendicular direction called a normal.

Comparing that normal with the direction of incoming light helps decide whether a surface should look bright, dim, or unlit. A light coming from behind a surface should not brighten its visible front.

When learning this topic, keep track of what each vector represents before calculating. Components must use the same coordinate system and the same order of axes. A common mistake is multiplying coordinates in the wrong pairs.

Another is confusing a scalar projection, which is one signed length, with a vector projection, which has a direction. Units provide a useful check.

Force dotted with displacement has units of energy, while velocity dotted with velocity has units related to speed squared. With decimal values, a result very close to zero may come from rounding, so do not claim exact perpendicularity unless the calculation or context supports it.

Key Facts

  • Algebraic formula: a · b = a1b1 + a2b2 in 2D, and a · b = a1b1 + a2b2 + a3b3 in 3D.
  • Angle formula: a · b = |a||b|cos(theta).
  • Solve for the angle: cos(theta) = (a · b)/(|a||b|).
  • Projection length of a onto b: comp_b(a) = (a · b)/|b|.
  • Vector projection of a onto b: proj_b(a) = ((a · b)/(|b|^2))b.
  • Orthogonality test: if a · b = 0 and neither vector is the zero vector, then a and b are perpendicular.

Vocabulary

Dot product
The dot product is a multiplication of two vectors that produces a scalar measuring directional alignment.
Scalar
A scalar is a quantity with magnitude only, such as a number, length, temperature, or energy.
Magnitude
The magnitude of a vector is its length, written as |a|.
Projection
A projection is the part of one vector that lies in the direction of another vector.
Orthogonal
Orthogonal vectors are perpendicular vectors whose dot product is zero.

Common Mistakes to Avoid

  • Multiplying matching components but forgetting to add them is wrong because the dot product is a sum of products, such as a · b = a1b1 + a2b2.
  • Treating the dot product as a vector is wrong because the result is a scalar, not a direction or arrow.
  • Using degrees or radians inconsistently in angle calculations is wrong because your calculator mode must match the angle units in cos(theta).
  • Dividing by |b| instead of |b|^2 for vector projection is wrong because proj_b(a) = ((a · b)/(|b|^2))b, while (a · b)/|b| gives only the scalar component length.

Practice Questions

  1. 1 Find the dot product of a = <3, -2> and b = <4, 5>.
  2. 2 Given a = <2, 1, 2> and b = <1, 0, 3>, find a · b, |a|, |b|, and the angle between them to the nearest degree.
  3. 3 If two nonzero vectors have a dot product of 0, explain what this means geometrically and why the projection of one vector onto the other has length 0.