Category

Angle Between Two Vectors Calculator — 2D and 3D Vectors

Calculate the angle between two 2D or 3D vectors using the dot product formula. Get the angle in degrees, radians, and gradians. Supports both metric and US/Imperial coordinate systems.

1 calculations

Calculation Parameters

xa
ya
za
xb
yb
zb

Enter Parameters

Enter vector components and click Calculate

Angle Between Two Vectors Calculator: 2D and 3D

With this angle between two vectors calculator, you'll quickly learn how to find the angle between two vectors. It doesn't matter if your vectors are in 2D or 3D — our tool handles both cases. Simply enter the components of two vectors and get the angle in degrees, radians, and gradians instantly.

Angle Between Two Vectors Formulas

Angle Between Two 2D Vectors

For vectors a = (xa, ya) and b = (xb, yb):

cos(θ) = (xa·xb + ya·yb) / (|a| · |b|)

where the magnitudes are:

|a| = √(xa² + ya²)    |b| = √(xb² + yb²)

Angle Between Two 3D Vectors

For vectors a = (xa, ya, za) and b = (xb, yb, zb):

cos(θ) = (xa·xb + ya·yb + za·zb) / (|a| · |b|)

The angle θ in radians: θ = arccos(cos θ)

The angle θ in degrees: θ° = θ · (180 / π)

How to Find the Angle Between Two Vectors?

The angle between two non-zero vectors is found using the dot product formula:

  1. Calculate the dot product: a · b = xa·xb + ya·yb (+ za·zb for 3D)
  2. Calculate the magnitudes |a| and |b|
  3. Divide: cos(θ) = (a · b) / (|a| · |b|)
  4. Apply arccos: θ = arccos(cos θ)
  5. Convert to degrees if needed: θ° = θ · 180/π

The result is always in the range [0°, 180°].

Angle Between Two 3D Vectors — Example

Let a = (1, 2, 3) and b = (4, 5, 6).

  1. Dot product: a · b = 1·4 + 2·5 + 3·6 = 4 + 10 + 18 = 32
  2. |a| = √(1 + 4 + 9) = √14 ≈ 3.7417
  3. |b| = √(16 + 25 + 36) = √77 ≈ 8.7749
  4. cos(θ) = 32 / (3.7417 × 8.7749) = 32 / 32.832 ≈ 0.9747
  5. θ = arccos(0.9747) ≈ 12.933°

Measurement Systems

This calculator supports:

  • Degrees (°) — the standard unit in everyday use (US customary and metric systems)
  • Radians (rad) — the SI unit of angular measure used in mathematics and physics
  • Gradians (grad) — also known as gon, used in surveying; a full circle = 400 grad

How to Use the Angle Between Two Vectors Calculator?

  1. Select 2D or 3D mode depending on your vectors.
  2. Enter the components of Vector A (xa, ya, and optionally za).
  3. Enter the components of Vector B (xb, yb, and optionally zb).
  4. Click Calculate.
  5. The result shows the angle in degrees, radians, and gradians, along with the dot product and magnitudes of both vectors.

FAQs

Can the angle between two vectors be greater than 180°?
No. The angle between two vectors is always between 0° and 180° (inclusive). If the vectors point in the same direction, θ = 0°. If they are opposite, θ = 180°.
What if the vectors are perpendicular?
If two vectors are perpendicular, their dot product equals 0, and the angle between them is exactly 90°.
What if the vectors are parallel?
Parallel vectors pointing in the same direction have θ = 0°. Antiparallel vectors (opposite directions) have θ = 180°.
Why can't a zero vector be used?
A zero vector has magnitude 0, making division by zero impossible in the formula. The angle between a zero vector and any other vector is undefined.
Does it matter which vector is A and which is B?
No. The angle between vectors is symmetric: the angle from a to b equals the angle from b to a.

Calculation History

Loading...