Vector Calculator

Calculate dot product, sum, difference and angle for matching vectors, plus the cross product for three-dimensional vectors.

Dot product32.0000

Its parts (components) separated by commas, such as 1, 2, 3. Use 2 to 10 parts.

The same number of parts as the first vector.

Dot product

32.0000

  • Vector sum5, 7, 9
  • Vector difference (first − second)-3, -3, -3
  • Angle between vectors12.9332 degrees
  • Cross product (first × second)-3, 6, -3
  • |a| (magnitude of first)3.7417
  • |b| (magnitude of second)8.7750

Vectors must be expressed in the same orthonormal coordinate system and compatible units.

How this was calculated

  1. The dot product multiplies the matching parts of the two vectors and adds the answers. It gives one plain number.a · b = a₁b₁ + a₂b₂ + … + aₙbₙPut in your numbers: 1×4 + 2×5 + 3×6 = 4 + 10 + 18Answer: 32
  2. The magnitude is the length of the first vector. Square each part, add them, then take the square root (like Pythagoras).|a| = √(a₁² + a₂² + …)Put in your numbers: √(1² + 2² + 3²) = √14Answer: 3.741657387
  3. Do the same for the second vector to get its length.|b| = √(b₁² + b₂² + …)Put in your numbers: √(4² + 5² + 6²) = √77Answer: 8.774964387
  4. To find the angle between the arrows, divide the dot product by the two lengths multiplied together, then use arccos (the inverse of cosine).θ = arccos[(a · b) ÷ (|a| × |b|)]Put in your numbers: arccos[32 ÷ (3.741657387 × 8.774964387)] = arccos(0.9746318462)Answer: 12.93315449°
  5. To add two vectors, add the matching parts. To take one away, subtract the matching parts.a + b and a − b add or subtract matching componentsPut in your numbers: (1 + 4, 2 + 5, 3 + 6); (1 − 4, 2 − 5, 3 − 6)Answer: (5, 7, 9); (-3, -3, -3)
  6. The cross product (only for 3 parts) gives a new vector that points at right angles to both vectors.a × b = (a₂b₃ − a₃b₂, a₃b₁ − a₁b₃, a₁b₂ − a₂b₁)Put in your numbers: (2×6 − 3×5, 3×4 − 1×6, 1×5 − 2×4)Answer: (-3, 6, -3)

Vectors in simple words

A vector is like an arrow. It has a size (how long it is) and a direction. We write it as a list of parts, such as (1, 2, 3), which means 1 step along x, 2 along y and 3 along z.

To add two vectors, add the matching parts: (1, 2, 3) + (4, 5, 6) = (5, 7, 9).

The dot product multiplies the matching parts and adds them: 1 × 4 + 2 × 5 + 3 × 6 = 4 + 10 + 18 = 32. A dot product of 0 means the arrows are at right angles.

The length (magnitude) comes from Pythagoras: square each part, add them and take the square root. For (1, 2, 3) that is √(1 + 4 + 9) = √14 ≈ 3.74.

Formula and method

The dot product sums corresponding component products. For nonzero vectors, cos θ = (a·b)/(|a||b|).

Worked example

Vectors (1, 0, 0) and (0, 1, 0) have dot product 0, angle 90° and cross product (0, 0, 1).

Worked example with substitution

For a = (1, 2, 3) and b = (4, 5, 6): a · b = 1×4 + 2×5 + 3×6 = 4 + 10 + 18 = 32. The magnitudes are |a| = √(1² + 2² + 3²) = √14 ≈ 3.7417 and |b| = √77 ≈ 8.7750.

The angle is θ = arccos[32 ÷ (3.7417 × 8.7750)] = arccos(0.97463) ≈ 12.93°. The cross product is (2×6 − 3×5, 3×4 − 1×6, 1×5 − 2×4) = (−3, 6, −3).

Frequently asked questions

Why is the cross product missing for other dimensions?

This tool uses the conventional three-dimensional cross product. Dot products, sums and differences work for the supported two to ten components.

References

Last updated . Results are estimates for informational purposes only.