Vector Calculator

A vector has both size and direction. This vector calculator takes two vectors in 2D or 3D and finds their dot product, magnitudes, sum and the angle between them, plus the cross product for 3D vectors. Two-dimensional vectors are drawn as arrows, with their sum shown by placing them tip to tail.

Try:

How to use the vector calculator

  1. Type vector a, such as 3, 4 or 1, 2, 3.
  2. Type vector b with the same number of components.
  3. Press Calculate to see the products, magnitudes and angle.

Formula

a⋅b=∣a∣∣b∣cos⁡θ\mathbf{a}\cdot\mathbf{b} = |\mathbf{a}||\mathbf{b}|\cos\theta

Worked example: ⟨3, 4⟩ and ⟨1, 2⟩

  • Vector a: 3, 4
  • Vector b: 1, 2

✓ Answer checked

a⋅b=11\mathbf{a}\cdot\mathbf{b} = 11
|a|
55
|b|
5\sqrt{5}
a + b
⟨4,6⟩\langle 4, 6 \rangle
Angle between
10.304846∘10.304846^\circ
−6−4−2246810−22468aba + b
a (blue) and b (light blue). Placing b at the tip of a gives a + b (green). The angle between them is 10.305°.
Step-by-step working (3 steps)
  1. Dot product a·b = a₁b₁ + a₂b₂ (+ a₃b₃)

    Multiply matching components and add.

    (3)(1)+(4)(2)=11(3)(1) + (4)(2) = 11
  2. Magnitudes

    Use Pythagoras on the components.

    ∣a∣=5,∣b∣=5|\mathbf{a}| = 5,\quad |\mathbf{b}| = \sqrt{5}
  3. Angle a·b = |a||b|cos θ

    Divide the dot product by the product of the magnitudes, then take the inverse cosine.

    cos⁡θ=115⋅5⇒θ≈10.304846∘\cos\theta = \frac{11}{5\cdot \sqrt{5}} \Rightarrow \theta \approx 10.304846^\circ
Formulas used
a⋅b=∣a∣∣b∣cos⁡θ\mathbf{a}\cdot\mathbf{b} = |\mathbf{a}||\mathbf{b}|\cos\theta
How this was checked
  • ✓ The angle from atan2(|a × b|, a · b) matches the angle from the dot product.

Frequently asked questions

How do I find the dot product?

Multiply matching components and add. For ⟨3, 4⟩ and ⟨1, 2⟩: 3 × 1 + 4 × 2 = 11.

What does a dot product of 0 mean?

The vectors are perpendicular (at 90° to each other), as long as neither is the zero vector.

What is the cross product?

For 3D vectors, a × b is a vector perpendicular to both, with length equal to the area of the parallelogram they make.

Related calculators

Related guides