Angle Between Two Vectors Calculator
This calculator finds the angle between two vectors in two or three dimensions using the dot product formula, the standard method used in physics, engineering, computer graphics and data science whenever you need to know how much two directions differ. Choose whether you are working in 2D or 3D, then enter the x, y (and z) components of vector A and vector B, for example forces, velocities or surface normals. The calculator works out the dot product of the two vectors and their magnitudes (lengths), divides one by the other to get the cosine of the angle, then takes the arccos to return the actual angle. Results appear as the angle in degrees and radians, the dot product, and a plain-English relationship such as parallel, perpendicular, acute or obtuse, so you can see at a glance how the vectors are oriented to each other. A working panel below shows every step, the dot product, both magnitudes, their product, cos(theta) and the final theta, so you can check the arithmetic or learn the method rather than just read off a number. Because the angle depends only on direction, not size, scaling a vector up or down never changes the result. Watch for the zero vector: if either vector has no length, the angle is mathematically undefined and the calculator flags this rather than showing a false answer.
1. Dimensions
2. Vector A
3. Vector B
Working
Vector Properties
How to Find the Angle Between Two Vectors
The angle between two vectors is found using the dot product formula. For vectors A and B, the formula is:
theta = arccos( (A · B) / (|A| × |B|) )
where A · B is the dot product and |A| and |B| are the magnitudes of the vectors. The result is always between 0 and 180 degrees (0 and pi radians).
Step-by-Step Method (3D Example)
For vectors A = (1, 2, 3) and B = (4, 5, 6):
| Step | Calculation | Result |
|---|---|---|
| Dot product | (1×4) + (2×5) + (3×6) | 4 + 10 + 18 = 32 |
| Magnitude |A| | sqrt(1² + 2² + 3²) = sqrt(14) | 3.7417 |
| Magnitude |B| | sqrt(4² + 5² + 6²) = sqrt(77) | 8.7750 |
| Product |A|×|B| | 3.7417 × 8.7750 | 32.8327 |
| cos(theta) | 32 / 32.8327 | 0.97463 |
| Angle theta | arccos(0.97463) | 12.93 degrees (0.2257 rad) |
This matches the calculator default output above.
Dot Product Formula
For 2D vectors A = (ax, ay) and B = (bx, by):
A · B = axbx + ayby
For 3D vectors A = (ax, ay, az) and B = (bx, by, bz):
A · B = axbx + ayby + azbz
Special Cases
| Angle | Dot Product | Relationship |
|---|---|---|
| 0 degrees | Positive maximum (= |A||B|) | Parallel (same direction) |
| 90 degrees | 0 | Perpendicular (orthogonal) |
| 180 degrees | Negative maximum (= -|A||B|) | Anti-parallel (opposite directions) |
2D Example
For vectors A = (3, 4) and B = (1, 0):
A · B = 3×1 + 4×0 = 3. |A| = sqrt(9+16) = 5. |B| = 1. cos(theta) = 3/5 = 0.6. theta = arccos(0.6) = 53.13 degrees.
Applications
The angle between vectors is used in physics (force components, work = F·d×cos(theta)), computer graphics (lighting calculations, surface normals), machine learning (cosine similarity between document vectors), and engineering (structural analysis, navigation).
Related Calculators
- Maths and Stats Calculators: full collection of maths tools.
- Dot Product Calculator: compute A · B for 2D and 3D vectors.
- SOHCAHTOA Solver: right-triangle trigonometry.
- Triangle Calculator: solve any triangle from sides and angles.
- Pythagorean Theorem Calculator: find the hypotenuse or a missing side.
- Area of an Obtuse Triangle Calculator: base-Height, SAS and Heron's.
- Area of Quadrilateral Calculator: trapezoid, Rhombus, Kite.
Sources and method: Dot product and angle formula from standard linear algebra. Anton, H. and Rorres, C. (2014). Elementary Linear Algebra. 11th ed. Wiley. Stewart, J. (2015). Calculus. 8th ed. Cengage. Formula: theta = arccos((A · B) / (|A||B|)) where the result is in the range [0, pi] radians.
This calculator computes the angle between two vectors using exact floating-point arithmetic. Results are rounded to four decimal places for display. The formula is valid for any non-zero vectors in 2D or 3D space. If either vector has zero magnitude, the angle is mathematically undefined.