Angle between two vectors calculator
The angle between two vectors comes from the dot product: cos θ = (a · b) ÷ (|a||b|). Multiply matching components and add to get a · b, divide by the product of the lengths, then take inverse cos. For a = (2, 1) and b = (1, 3), a · b = 5, |a| = √5 and |b| = √10, so cos θ = 5 ÷ √50 and θ = 45°. This angle between two vectors calculator is part of our Vectors Calculator, in 2D or 3D.
Vectors Calculator
Visualise magnitude, direction and operations
How to find the angle in the calculator
- Open the Vectors Calculator. It starts in Single mode, so choose Two Vectors for 2D or 3D at the top.
- Under Vectors, type the components of vector a and vector b, or drag their tips on the grid.
- Read θ, the angle between them, in Results, along with the dot product a · b. In 3D you also get both magnitudes and the cross product.
- Under Display, the Degrees chip switches the angle between degrees and radians.
- Open Formulas to see the angle formula with your numbers.
Angle between two vectors formula
In 2D, a · b = a₁b₁ + a₂b₂, and in 3D add a₃b₃. The magnitude |a| is √(a₁² + a₂² + a₃²). The angle always comes out between 0° and 180°: it is the angle between the vectors placed tail to tail.
Worked examples you can check in the calculator
Example 1: two 2D vectors
θ = cos⁻¹(0.7071) = 45°. Choose Two Vectors and type a = (2, 1) and b = (1, 3).
Example 2: the calculator's 2D vectors
Two Vectors starts with a = (5, 5) and b = (−3, 4). a · b = −15 + 20 = 5, |a| = √50 = 7.071 and |b| = 5, so cos θ = 5 ÷ 35.36 = 0.1414 and θ = 81.9°.
Example 3: two 3D vectors
In 3D mode the calculator starts with a = (3, 4, 2) and b = (−1, 2, 5). a · b = −3 + 8 + 10 = 15, |a| = √29 = 5.385 and |b| = √30 = 5.477:
Example 4: perpendicular and parallel vectors
For a = (4, −2) and b = (1, 2), a · b = 4 − 4 = 0, so cos θ = 0 and θ = 90°: the vectors are perpendicular. A zero dot product is the quick test for a right angle. At the other extreme, (1, 2) and (−2, −4) point in exactly opposite directions, and the angle between them is 180°.
Try one
What the sign of the dot product tells you
| a · b | Angle | Meaning |
|---|---|---|
| Positive | Less than 90° | The vectors point broadly the same way |
| Zero | Exactly 90° | Perpendicular |
| Negative | More than 90° | The vectors point broadly opposite ways |
Where the angle between vectors is used
In physics, the work done by a force is the dot product of the force and the displacement: W = F · d = |F||d| cos θ. A force of (3, 4) N that moves an object (5, 0) m does W = 3 × 5 + 4 × 0 = 15 J of work. The force has magnitude 5 N, so cos θ = 15 ÷ (5 × 5) = 0.6 and the force acts at 53.1° to the motion. Only the part of the force along the motion, 5 cos 53.1° = 3 N, does any work. The same angle formula finds the angle between two lines in 3D geometry, using their direction vectors.
Common mistakes
- Forgetting to divide by the magnitudes. The dot product on its own isn't cos θ.
- Calculator in the wrong mode. cos⁻¹ in radians gives a number like 0.785 instead of 45.
- Adding components instead of multiplying. a · b multiplies matching components, then adds.
- Using vectors placed head to tail. The angle is between the vectors tail to tail.
- Sign slips with negative components. Bracket them: 5 × (−3) = −15.
Common questions
How do you find the angle between two vectors?
How do you know if two vectors are perpendicular?
Does the same formula work in 3D?
Can the angle be more than 180°?
Can I see the answer in radians?
Revision cards
Read the front, say your answer, then flip to check.
Where to go next
- Solve it
Vectors Calculator
Visualise magnitude, direction and operations
Open the tool - Test it
Geometry, Algebra 2 & SAT Math
A new exam-style paper every day, with instant marking and a mark scheme
Start today's paper - Test it
College Linear Algebra
A new exam-style paper every day, with instant marking and a mark scheme
Start today's paper