Connect via MCP →

Enter Calculation

Leave the z fields blank or 0 for 2D vectors.

Formula

Advertisement

Results

Angle Between Vectors
90°
1.570796 radians
Dot product (a·b) 0
Magnitude |a| 1
Magnitude |b| 1
cos θ 0

What is the Angle Between Two Vectors Calculator?

This tool computes the angle between two vectors given their components in 2D or 3D space. It uses the dot product relationship, one of the most fundamental identities in vector algebra. Whether you are working in physics, computer graphics, machine learning, or engineering, knowing the angle between two directions is a common and essential task.

Two vectors sharing a common origin with the angle theta marked between them
The angle θ is measured between two vectors drawn from a shared origin.

How to use it

Enter the x, y, and z components of Vector A and Vector B. For two-dimensional problems, simply leave the z fields blank or set them to 0. The calculator returns the angle in both degrees and radians, and also shows the dot product, each vector's magnitude, and the cosine of the angle so you can follow the work.

The formula explained

The angle θ satisfies:

$$\theta = \arccos\left( \dfrac{\vec{a} \cdot \vec{b}}{\lVert \vec{a} \rVert \, \lVert \vec{b} \rVert} \right)$$

Here the dot product is \(\vec{a} \cdot \vec{b} = a_x b_x + a_y b_y + a_z b_z\), and each magnitude is the square root of the sum of squared components, e.g. \(\lVert \vec{a} \rVert = \sqrt{a_x^2 + a_y^2 + a_z^2}\). Dividing the dot product by the product of magnitudes gives \(\cos\theta\), and taking the arccosine yields the angle, which always lies between 0° and 180°.

Advertisement
Dot product projection of vector a onto vector b illustrating the cosine relationship
The dot product relates to the projection of one vector onto the other, giving cos θ.

Worked example

Take \(\vec{a} = (1, 0, 0)\) and \(\vec{b} = (1, 1, 0)\). The dot product is \(1\cdot 1 + 0\cdot 1 + 0\cdot 0 = 1\). The magnitudes are \(\lVert \vec{a} \rVert = 1\) and \(\lVert \vec{b} \rVert = \sqrt{2} \approx 1.4142\). So $$\cos\theta = \frac{1}{1 \times 1.4142} \approx 0.7071,$$ and \(\theta = \arccos(0.7071) = 45°\).

FAQ

Can it handle 2D vectors? Yes — leave the z components at 0 and the math reduces to the planar case.

What if a vector is zero? The angle is undefined for a zero vector, so the calculator returns 0 to avoid dividing by zero.

Why is the result always between 0 and 180 degrees? The arccosine function only outputs values in that range, which represents the smallest non-directional angle between the two vectors.

Last updated: