CompoundPage

Dot product calculator

(1, 2, 3) ⋅ (4, 5, 6) is 32 in the dot product calculator: 4 + 10 + 18, and the vectors are 12.93° apart.

Ignored in 2D.

Ignored in 2D.

Dot product32

a ⋅ b Multiply matching components and add. The answer is a single number, not a vector, which is why it is also called the scalar product.
32
Working
(1)(4) + (2)(5) + (3)(6) = 4 + 10 + 18 = 32
What the sign says a ⋅ b = |a||b|cos θ, and the lengths are never negative, so the sign of the dot product is the sign of cos θ. That makes it the quickest perpendicularity test there is.
positive: the angle is under 90°
|a||b|cos θ The same number by the geometric definition. The two definitions agreeing is what lets you get the angle out of the components.
√14 × √77 × cos(12.93315°) = 32
a and b
a = (1, 2, 3), b = (4, 5, 6)
How a and b relate Orthogonal means the dot product is zero; parallel means the cross product is zero. Those are the two tests, and both are exact for whole-number components.
neither parallel nor orthogonal: 12.93315° apart
Every operation on these two vectors
OperationResult
a ⋅ b32
a × b(-3, 6, -3)
a + b(5, 7, 9)
a - b(-3, -3, -3)
|a|, |b|√14 ≈ 3.741657, √77 ≈ 8.774964
Unit vector of a(√14/14, √14/7, 3√14/14)
Angle between12.93315°
Projection of a onto b(128/77, 160/77, 192/77)
  • Every component is a whole number, so lengths, unit vectors, cosines and projections are given exactly, as fractions and simplified square roots, with decimals alongside.
  • The cross product is an operation on 3D vectors. For 2D input the vectors are placed in the xy-plane, and the cross product's z component is the signed area of their parallelogram.

How the Vector Calculator works

The dot product formula is a ⋅ b = a₁b₁ + a₂b₂ + a₃b₃: multiply the matching components and add. In two dimensions drop the third term. The answer is a single number.

For a = (1, 2, 3) and b = (4, 5, 6): 1 × 4 + 2 × 5 + 3 × 6 = 4 + 10 + 18 = 32.

The geometric form is a ⋅ b = |a||b| cos θ, where θ is the angle between the vectors. Here |a| = √14 and |b| = √77, so cos θ = 32 ÷ √1078 = 0.9746 and θ = 12.93°.

The sign says how the vectors point: positive when the angle between them is under 90°, zero when they are perpendicular, and negative when it is over 90°. (1, 2) ⋅ (2, -1) = 2 - 2 = 0, so those two are at right angles.

Work in physics is a dot product, force ⋅ displacement: a 10 N force at 60° to a 5 m move does 10 × 5 × cos 60° = 25 J. A vector dotted with itself is its length squared: (1, 2, 3) ⋅ (1, 2, 3) = 14.

Vector Calculator FAQ

How is the dot product different from the cross product?

The dot product of two vectors is a number. The cross product of two 3D vectors is a third vector, perpendicular to both: (1, 2, 3) × (4, 5, 6) = (-3, 6, -3).

Does the order matter?

No: a ⋅ b = b ⋅ a, because each term is a product of two numbers.

What is the projection of a onto b?

(a ⋅ b ÷ |b|²) × b. For these vectors, 32 ÷ 77 × (4, 5, 6) = (1.662, 2.078, 2.494).

Related calculators

Embed this calculator
<div id="compoundpage-vector-calculator"></div>
<script src="https://compoundpage.com/embed/vector-calculator.js" async></script>

The same calculation as JSON