Angle Between Vectors Calculator
Math, Vectors, Geometry, Calculator
Find the angle between two vectors
Vector A and Vector B
Final answer
Intro: Use this calculator to find the angle between two vectors from their components in 2D or 3D. It shows the dot product, both magnitudes, the cosine value, and the final angle in degrees and radians. Exact/decimal; returns degrees and radians.
Worked example
- $a=(2,0,−1), b=(1,3,4)$
- Dot product: $$\vec a\cdot\vec b = 2\cdot1 + 0\cdot3 + (-1)\cdot4 = 2 - 4 = -2.$$
- Norms: $$\|\vec a\|=\sqrt{2^2 + 0^2 + (-1)^2}=\sqrt{4+0+1}=\sqrt{5},\qquad \|\vec b\|=\sqrt{1^2+3^2+4^2}=\sqrt{1+9+16}=\sqrt{26}.$$
- Cosine of the angle: $$\cos\theta = \dfrac{\vec a\cdot\vec b}{\|\vec a\|\,\|\vec b\|} = \dfrac{-2}{\sqrt{5}\,\sqrt{26}} = \dfrac{-2}{\sqrt{130}}.$$
- Exact expression for the angle: $$\theta = \arccos\!\left(\dfrac{-2}{\sqrt{130}}\right).$$
- Decimal evaluation: $$\dfrac{-2}{\sqrt{130}}\approx -0.1754 \;\Rightarrow\; \theta\approx 100.1^{\circ}.$$
- Radians: $$\theta\approx 100.1^{\circ}\times\dfrac{\pi}{180}\approx 1.746\,\text{rad}.$$
- Sanity checks:
- • Since $\vec a\cdot\vec b<0$, the angle should be obtuse ($>90^{\circ}$) ✔️.
- • Bounds: $-1\le\cos\theta\le1$ holds because $-2/\sqrt{130}\in[-1,1]$ ✔️.
- Find the angle between $\mathbf{a} = [1, 2, 2]$ and $\mathbf{b} = [2, 0, 1]$.
- Compute the dot product: $$1\cdot2 + 2\cdot0 + 2\cdot1 = 4.$$
- Compute the magnitudes: $$|\mathbf{a}|=\sqrt{1^2+2^2+2^2}=3,\qquad |\mathbf{b}|=\sqrt{2^2+0^2+1^2}=\sqrt{5}.$$
- Find the cosine: $$\cos\theta=\frac{4}{3\sqrt{5}}.$$
- Take the inverse cosine: $$\theta=\cos^{-1}\left(\frac{4}{3\sqrt{5}}\right)\approx 53.13^\circ\approx 0.9273\text{ rad}.$$
FAQs
Zero vector?
The angle is undefined if either vector is the zero vector (division by zero in the formula).
Units?
We report degrees and radians. You can request only one if you prefer.
Higher dimensions?
The same dot-product formula works in any dimension as long as the vectors have equal length.
What is the formula for the angle between two vectors?
Use $$\theta=\cos^{-1}\!\left(\frac{\mathbf{a}\cdot\mathbf{b}}{|\mathbf{a}||\mathbf{b}|}\right)$$ for nonzero vectors.
Can this calculator handle 2D and 3D vectors?
Yes. It accepts either two components for 2D or three components for 3D, as long as both vectors have the same dimension.
What does a negative dot product mean?
A negative dot product means the angle is obtuse, so the vectors point more in opposite than in the same direction.
Why is the zero vector invalid?
Because its magnitude is 0, the denominator in the angle formula becomes zero, so the angle is undefined.
Why use this angle between vectors calculator?
- Built for quick vector-angle calculations in 2D and 3D.
- Shows the full dot-product method so you can verify each step.
- Returns both degrees and radians for easy checking and reuse.
How to Find the Angle between Vectors
- First compute the dot product a·b = Σ a_i b_i
- Next, compute the magnitudes ‖a‖ = √(Σ a_i^2) and ‖b‖ = √(Σ b_i^2)
- Finally, calculate the angle θ = arccos( (a·b) / (‖a‖‖b‖) ), then convert to degrees/radians as needed
