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.

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.