The angle between vectors tells you how aligned two directions are: 0° means the same direction, 90° perpendicular and 180° opposite. It is used for forces in physics, lighting in computer graphics, and similarity of documents and embeddings in data science.
How to use the Angle Between Two Vectors Calculator
- Dimension
- Vectors given by
- u: x
- u: y
- u: z
- v: x
- v: y
- v: z
- A: x
- A: y
- A: z
- B: x
- B: y
- B: z
- C: x
- C: y
- C: z
- D: x
- D: y
- D: z
Results update as you type, and everything is calculated in your browser.
How it works
Choose 2D or 3D and how the vectors are given. With points, each vector is end minus start. The dot product divided by the product of the lengths is the cosine of the angle.
Tips
- Angles are measured counter-clockwise from the positive x-axis by default.
- Add or subtract 360° (2π) to move between coterminal angles.
- Complementary angles add to 90°, supplementary angles to 180°.
- Use the unit menu to switch between degrees, radians and gradians.
Common mistakes to avoid
- Mixing up complementary and supplementary angles.
- Forgetting that a reference angle is always between 0° and 90°.
- Leaving an angle in radians when the question asks for degrees.
Inputs explained
| Field | What to enter |
|---|---|
| Dimension | Choose one: 2D, 3D |
| Vectors given by | Choose one: Coordinates, Start and end points |
| u: x | A number |
| u: y | A number |
| u: z | A number |
| v: x | A number |
| v: y | A number |
| v: z | A number |
| A: x | A number |
| A: y | A number |
| A: z | A number |
| B: x | A number |
| B: y | A number |
| B: z | A number |
| C: x | A number |
| C: y | A number |
| C: z | A number |
| D: x | A number |
| D: y | A number |
| D: z | A number |
What each result means
- Dot product u · v = [u x]×[v x] + [u y]×[v y] + [u z]×[v z]
- |u| = sqrt([u x]^2 + [u y]^2 + [u z]^2)
- |v| = sqrt([v x]^2 + [v y]^2 + [v z]^2)
- Angle θ = deg(acos(clamp([Dot product u · v]÷([|u|]×[|v|]), -1, 1)))
- cos θ = [Dot product u · v]÷([|u|]×[|v|])
Example values
How the main result changes when u: x changes and everything else stays at the example values above:
| u: x | Angle θ (°) |
|---|---|
| 1.5 | 106.3139 |
| 2.25 | 97.5121 |
| 3 | 90 |
| 3.75 | 83.7175 |
| 4.5 | 78.5034 |
| 6 | 70.56 |
Formula
cos θ = (u · v) / (|u| · |v|)
u · v = uₓvₓ + u_yv_y + u_zv_z
Worked example
Inputs — Dimension: 2D; Vectors given by: Coordinates; u: x: 3; u: y: 4; v: x: 4; v: y: -3.
Results — Dot product u · v = 0; |u| = 5; |v| = 5; Angle θ = 90 °; cos θ = 0.
Key terms
- Dot product
- The sum of products of matching components.
Frequently asked questions
What does a dot product of zero mean?
The vectors are perpendicular (90°).
Can the angle be more than 180°?
No – the angle between vectors is between 0° and 180°.
How do I get vectors from points?
Subtract the start point from the end point.
What is cosine similarity?
cos θ – used to compare documents and embeddings.