# Find the angle between two vectors

Finds the angle between two vectors in 2D, 3D or up to 10 dimensions, in degrees and radians, with the dot product, the lengths, cos θ, and whether they are perpendicular or parallel.

- Page: https://www.acalculator.org/math/angle-between-vectors-calculator
- JSON spec: https://www.acalculator.org/math/angle-between-vectors-calculator.json
- Version: 44c6f24106f2

## Default answer

Example with the default inputs (Vector a [1, 1, 1], Vector b [2, -1, -3]): The angle between ⟨1, 1, 1⟩ and ⟨2, −1, −3⟩ is 107.975284°.

## Inputs

| Key | Label | Description |
| --- | --- | --- |
| a | Vector a | The first vector’s components, such as 1, 1, 1. |
| b | Vector b | The second vector’s components, as many as a has. |

## Outputs

| Key | Label | Description |
| --- | --- | --- |
| degrees | Angle θ | The angle between the two vectors in degrees, from 0° to 180°. |
| radians | Angle in radians | The same angle in radians, from 0 to π. |
| cos | cos θ | The dot product divided by the product of the lengths, from −1 to 1. |
| dot | Dot product a·b | The sum of the products of matching components. |
| lengthA | Length ‖a‖ | The magnitude of vector a. |
| lengthB | Length ‖b‖ | The magnitude of vector b. |
| vectors | Vectors | The two vectors as typed, each component to 6 significant digits. |
| kind | The vectors are | Perpendicular (a·b = 0), parallel, opposite, or at an acute or obtuse angle. |

## Method

cos θ = a·b ÷ (‖a‖‖b‖); θ = 2·atan2(‖â − b̂‖, ‖â + b̂‖) with â = a ÷ ‖a‖ and b̂ = b ÷ ‖b‖ (the same angle, precise near 0° and 180°).

## Assumptions

- The angle is the smaller one between the two directions, from 0° to 180°.
- Both vectors have the same number of components (2 to 10) and neither is the zero vector.
- Perpendicular (a·b = 0) and parallel ((a·b)² = ‖a‖²‖b‖²) are decided exactly from the numbers as typed.

## Worked examples

1. a = 1 or 1, b = 2 or -1 gives degrees = 107.975284, radians = 1.884524, cos = -0.308607, dot = -2, kind = at an obtuse angle. Source: OpenStax, Calculus Volume 3, §2.3 The Dot Product (cos θ = u·v ÷ (‖u‖‖v‖); Example 2.23: i + j + k and 2i − j − 3k make θ = arccos(−2 ÷ √42), and ⟨2, 5, 6⟩ and ⟨−2, −4, 4⟩ are orthogonal). https://openstax.org/books/calculus-volume-3/pages/2-3-the-dot-product.
2. a = 2 or 5, b = -2 or -4 gives degrees = 90, radians = 1.570796, dot = 0, kind = perpendicular (orthogonal). Source: OpenStax, Calculus Volume 3, §2.3 The Dot Product (cos θ = u·v ÷ (‖u‖‖v‖); Example 2.23: i + j + k and 2i − j − 3k make θ = arccos(−2 ÷ √42), and ⟨2, 5, 6⟩ and ⟨−2, −4, 4⟩ are orthogonal). https://openstax.org/books/calculus-volume-3/pages/2-3-the-dot-product.
3. a = 3 or 4, b = 4 or 3 gives degrees = 16.260205, dot = 24, cos = 0.96, lengthA = 5, lengthB = 5. Source: OpenStax, Calculus Volume 3, §2.3 The Dot Product (cos θ = u·v ÷ (‖u‖‖v‖); Example 2.23: i + j + k and 2i − j − 3k make θ = arccos(−2 ÷ √42), and ⟨2, 5, 6⟩ and ⟨−2, −4, 4⟩ are orthogonal). https://openstax.org/books/calculus-volume-3/pages/2-3-the-dot-product.
4. a = 1 or 2, b = -2 or -4 gives degrees = 180, kind = parallel, pointing opposite ways. Source: OpenStax, Calculus Volume 3, §2.3 The Dot Product (cos θ = u·v ÷ (‖u‖‖v‖); Example 2.23: i + j + k and 2i − j − 3k make θ = arccos(−2 ÷ √42), and ⟨2, 5, 6⟩ and ⟨−2, −4, 4⟩ are orthogonal). https://openstax.org/books/calculus-volume-3/pages/2-3-the-dot-product.

## FAQ

### How do I find the angle between two vectors?

Divide the dot product by the product of the lengths to get cos θ, then take the inverse cosine: θ = arccos(a·b ÷ (‖a‖‖b‖)). For ⟨3, 4⟩ and ⟨4, 3⟩, a·b = 24 and ‖a‖‖b‖ = 25, so θ = arccos 0.96 ≈ 16.26°.

### What is the angle between i + j + k and 2i − j − 3k?

The dot product is 2 − 1 − 3 = −2, the lengths are √3 and √14, so cos θ = −2 ÷ √42 and θ ≈ 107.98° (1.8845 radians). This is Example 2.23 in OpenStax Calculus Volume 3.

### How do I know if two vectors are perpendicular?

Their dot product is 0, so cos θ = 0 and θ = 90°. ⟨2, 5, 6⟩ and ⟨−2, −4, 4⟩ give −4 − 20 + 24 = 0, so they are orthogonal.

### How do I know if two vectors are parallel?

One is a multiple of the other, so the angle is 0° (same way) or 180° (opposite ways). ⟨1, 2⟩ and ⟨−2, −4⟩ are opposite: b = −2a and θ = 180°.

### Can the angle be more than 180°?

No. The angle between two vectors is the smaller of the two angles between their directions, from 0° to 180°. An obtuse angle (over 90°) means the dot product is negative.

### Why can I not use a zero vector?

The zero vector has length 0 and no direction, so cos θ would divide by 0. The page gives no answer for it.

## Sources

- OpenStax, Calculus Volume 3, §2.3 The Dot Product (cos θ = u·v ÷ (‖u‖‖v‖); Example 2.23: the angle between i + j + k and 2i − j − 3k is arccos(−2 ÷ √42), and ⟨2, 5, 6⟩ and ⟨−2, −4, 4⟩ are orthogonal). https://openstax.org/books/calculus-volume-3/pages/2-3-the-dot-product (retrieved 2026-10-02)
