Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

iTechGuides is reader-supported. When you buy through links on our site, we may earn an affiliate commission. As an Amazon Associate I earn from qualifying purchases. Learn more

To calculate a dot product, multiply each pair of matching vector components and add the products. For example, (2, -1) · (3, 4) = (2 × 3) + (-1 × 4) = 2. The result is one number—a scalar—not a vector.

Calculate a dot product from coordinates

Both vectors must have the same number of components, so corresponding entries can be paired. For real vectors u = (u₁, u₂, …, uₙ) and v = (v₁, v₂, …, vₙ), the coordinate formula is:

u · v = u₁v₁ + u₂v₂ + … + uₙvₙ

  1. Check that the vectors have the same number of components.
  2. Pair entries in the same position.
  3. Multiply each pair, keeping track of negative signs.
  4. Add all the products. The final answer is a scalar.

For example:

(1, 2, 3) · (4, -1, 2) = (1 × 4) + (2 × -1) + (3 × 2) = 4 - 2 + 6 = 8

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

The component products are intermediate steps; they are not the answer until added. Adding the vector components first, or returning a list of pairwise products, does not calculate the dot product.

Why the result is a number

The dot product is defined as a sum of component-by-component products. Since that sum is a single value, its output is a scalar. It is not the component-wise product of two vectors, and it is not an angle.

What the dot product tells you about direction

The same quantity has a geometric description: u · v = ||u|| ||v|| cos θ, where ||u|| and ||v|| are the vectors’ lengths and θ is the angle between them. The coordinate calculation and this magnitude-angle formula describe the same scalar. The coordinate formula is convenient when the components are given; the geometric formula is useful when lengths and the angle are known. See MIT World’s explanation of the dot product.

For nonzero vectors, the sign indicates directional alignment:

What’s actually slowing this PC down?

Pick the symptom - the matching free tool is one click away.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
  • A positive dot product corresponds to an acute angle.
  • A zero dot product corresponds to a right angle.
  • A negative dot product corresponds to an obtuse angle.

The zero vector is an exception to the angle interpretation: its dot product with every vector is zero, but it does not define a usual direction or angle.

When does a dot product equal zero?

If both vectors are nonzero, a dot product of zero means they are perpendicular, or orthogonal. If either vector is the zero vector, the result is also zero, so a zero result by itself does not always prove that the vectors meet at a right angle. The University of Nebraska–Lincoln’s linear algebra text discusses the zero-dot-product criterion.

Use the dot product to find an angle or a length

Finding the angle

When both vectors are nonzero, rearrange the magnitude-angle formula:

θ = arccos((u · v) / (||u|| ||v||))

Use the calculator’s angle mode appropriate to the units you want—degrees or radians—when evaluating arccos.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Finding vector length

A vector dotted with itself equals its squared length: u · u = ||u||². Therefore, ||u|| = √(u · u). A self-dot-product cannot be negative; it is zero only when every component of the vector is zero. This identity and other basic properties appear in the UNL text.

Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Useful checks and a practical application

The following properties can help check a calculation:

  • Symmetry: u · v = v · u.
  • Distributivity: u · (v + w) = (u · v) + (u · w).
  • Scalar factors: (c u) · v = c(u · v).
  • Self-dot-product: u · u is nonnegative.

The dot product also appears in physics: for a constant force and a displacement, work is the dot product of the force and displacement vectors. Paul’s Online Math Notes outlines this application.

The geometric interpretation also explains why the value does not depend on which rotated coordinate axes are used to describe the same vectors. MIT OpenCourseWare’s dot-product section states that the dot product is invariant under rotation of coordinates.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.