Overview
This finds the angle between two 3D vectors from their components. Use it in physics, graphics and geometry.
For 2D vectors, enter 0 for both z-components.
Worked examples
| Inputs | Result |
|---|---|
| A x-component1A y-component2A z-component3B x-component4B y-component5B z-component6 | Angle: 12.933°In radians: 0.2257Dot product: 32 |
Show 2 more examples
| A x-component1A y-component0A z-component0B x-component0B y-component1B z-component0 | Angle: 90°In radians: 1.5708Dot product: 0 |
| A x-component3A y-component4A z-component0B x-component-4B y-component3B z-component0 | Angle: 90°In radians: 1.5708Dot product: 0 |
Angle by b z-component
With the calculator's starting values, the angle is 12.933°. The table shows how it changes with the b z-component.
| B z-component | Angle (°) |
|---|---|
| 3 | 29.62° |
| 4 | 23.017° |
| 5 | 17.44° |
| 6starting value | 12.933° |
| 7 | 9.594° |
| 8 | 7.643° |
| 9 | 7.223° |
Other inputs: A x-component: 1 · A y-component: 2 · A z-component: 3 · B x-component: 4 · B y-component: 5. Change them in the calculator above for your own numbers.
How it works
The dot product of two vectors equals the product of their lengths times the cosine of the angle between them. Rearranging gives the angle. A positive dot product means less than 90°, zero means exactly 90°, and a negative one means more than 90°.
The formula
| A · B | Dot product |
| |A|, |B| | Vector lengths |
Practical tips
- (1, 2, 3) and (4, 5, 6) have a dot product of 32 and an angle of 12.933°.
- Perpendicular vectors have a dot product of 0.
- The result is always from 0° to 180°, whichever vector you list first.
Frequently asked questions
Why not a zero vector?
It has no direction, so the angle isn’t defined.
Does the length of the vectors matter?
No. Scaling a vector by a positive number doesn’t change the angle.