Connect via MCP →

Enter Calculation

Leave components blank or 0 for 2D vectors (just fill a₁,a₂,b₁,b₂).

Formula

Show calculation steps (1)
  1. Angle Between Vectors

    Angle Between Vectors: Dot Product Calculator

    Angle from the dot product and magnitudes; result in degrees.

Advertisement

Results

Dot Product (a · b)
32
scalar
Magnitude of a (|a|) 3.7417
Magnitude of b (|b|) 8.775
Angle between vectors 12.93°

What Is the Dot Product?

The dot product (also called the scalar product) takes two vectors and returns a single number. For vectors a = (a₁, a₂, a₃) and b = (b₁, b₂, b₃), it is the sum of the products of their matching components: $$\mathbf{a} \cdot \mathbf{b} = a_1 b_1 + a_2 b_2 + a_3 b_3.$$ The result is a scalar, not a vector. It is one of the most fundamental operations in linear algebra, physics, computer graphics, and machine learning.

Two vectors from a common origin with the angle theta between them
The dot product relates two vectors via the angle \(\theta\) between them.

How to Use This Calculator

Enter the components of vector a in the first row and vector b in the second row. For 2D vectors, simply leave the third components (\(a_3\) and \(b_3\)) at 0. Click calculate and you'll get the dot product, the magnitude (length) of each vector, and the angle between them in degrees.

The Formula Explained

Each component of a is multiplied by the corresponding component of b, and the products are added. The angle \(\theta\) between the two vectors comes from the relationship \(\mathbf{a}\cdot\mathbf{b} = \lVert\mathbf{a}\rVert\,\lVert\mathbf{b}\rVert\cos\theta\), where \(\lVert\mathbf{a}\rVert = \sqrt{a_1^2+a_2^2+a_3^2}\). Rearranging gives $$\theta = \arccos\left(\frac{\mathbf{a}\cdot\mathbf{b}}{\lVert\mathbf{a}\rVert\,\lVert\mathbf{b}\rVert}\right).$$

Geometric projection of vector b onto vector a
Geometrically, \(\mathbf{a}\cdot\mathbf{b}\) equals \(\lVert\mathbf{a}\rVert\) times the projection of b onto a.

Worked Example

Let \(\mathbf{a} = (1, 2, 3)\) and \(\mathbf{b} = (4, 5, 6)\). The dot product is $$(1\times 4) + (2\times 5) + (3\times 6) = 4 + 10 + 18 = \mathbf{32}.$$ The magnitudes are \(\lVert\mathbf{a}\rVert = \sqrt{14} \approx 3.742\) and \(\lVert\mathbf{b}\rVert = \sqrt{77} \approx 8.775\). The angle is $$\arccos\left(\frac{32}{3.742 \times 8.775}\right) \approx 12.93°.$$

FAQ

What does a dot product of zero mean? It means the two vectors are perpendicular (orthogonal) — the angle between them is 90°.

Can the dot product be negative? Yes. A negative dot product means the angle between the vectors is greater than 90° (they point in generally opposite directions).

How is it different from the cross product? The dot product returns a scalar, while the cross product returns a vector perpendicular to both inputs and exists only in 3D.

Last updated: