---
slug: vector-angle-calculator
title: "Vector Angle Calculator"
category: math
updated: 2026-11-18
canonical: https://calcseed.com/c/math/vector-angle-calculator/
html: /c/math/vector-angle-calculator/
---

# Vector Angle Calculator

Find the angle between two 3D vectors using the dot product.

## Quick answer

**Quick answer:** with the default inputs (1, 0, 0, 0), the angle (degrees) is **90**. At these inputs: dot product = **0**, angle (radians) = **1.57**. Change any input to update the result.

## Default calculation

Values computed by this calculator at exactly the default inputs listed below.

### Inputs (defaults)

| Input | Value | Unit |
| --- | --- | --- |
| a x | 1 |  |
| a y | 0 |  |
| a z | 0 |  |
| b x | 0 |  |
| b y | 1 |  |
| b z | 0 |  |

### Outputs at these defaults

| Output | Value | Unit |
| --- | --- | --- |
| Angle (degrees) | 90 |  |
| Dot product | 0 |  |
| Angle (radians) | 1.5708 |  |

## Formula

```text
cos &theta; = (a &middot; b) ÷ (|a| × |b|)
```

## Inputs

| Variable | Type | Unit | Default |
| --- | --- | --- | --- |
| a x | number |  | 1 |
| a y | number |  | 0 |
| a z | number |  | 0 |
| b x | number |  | 0 |
| b y | number |  | 1 |
| b z | number |  | 0 |

## Outputs

| Result | Format |
| --- | --- |
| Angle (degrees) | primary |
| Dot product | number |
| Angle (degrees) | number |
| Angle (radians) | number |

## How it works

### What this calculator does

Enter two 3D vectors and the calculator returns the angle between them in both degrees and radians, along with the dot product it used. With the defaults a = (1, 0, 0) and b = (0, 1, 0) the dot product is 0, so the angle comes out at exactly 90&deg; (about 1.571 radians) — the two default vectors are perpendicular.

### The dot-product formula

The angle comes from the dot product a &middot; b = ax×bx + ay×by + az×bz, divided by the product of the two lengths. Only the direction of each vector matters: (1, 0, 0) and (2, 0, 0) make the same angle with any third vector, because scaling a vector stretches it without turning it.

### Worked example: a = (1, 2, 2) and b = (3, 0, 1)

- Dot product: 1×3 + 2×0 + 2×1 = 3 + 0 + 2 = 5
- Magnitude of a: &radic;(1 + 4 + 4) = &radic;9 = 3
- Magnitude of b: &radic;(9 + 0 + 1) = &radic;10 ≈ 3.162
- Cosine: 5 ÷ (3 × 3.162) ≈ 0.527
- Angle: arccos(0.527) ≈ 58.2&deg; ≈ 1.016 radians

Run the same inputs through the calculator and it reports 58.19&deg;, which matches the hand computation. The result also passes a sanity check: 58.2&deg; is less than 90&deg;, as expected for a positive cosine, and greater than 45&deg; (cosine 0.707), as expected for a cosine of 0.527. A second quick case: a = (2, 1, 0) and b = (0, 1, 3) gives a dot product of 1, magnitudes of &radic;5 ≈ 2.236 and &radic;10 ≈ 3.162, a cosine of 1 ÷ (2.236 × 3.162) ≈ 0.141, and an angle of arccos(0.141) ≈ 81.9&deg; — close to perpendicular, but not quite.

### From cosine to angle by hand

The arccos step deserves its own attention because it is where most hand errors happen. Three anchor values pin down the scale: a cosine of 1 means 0&deg;, a cosine of 0 means 90&deg;, and a cosine of −1 means 180&deg;. Between those anchors the mapping is not linear — arccos(0.5) = 60&deg; and arccos(0.866) = 30&deg;, so the cosine compresses rapidly near the ends. That nonlinearity is why a cosine difference of 0.1 matters far more near &plusmn;1 than near 0, and why cosine-similarity scores of 0.95 and 0.98 represent very different angular gaps (18.2&deg; versus 11.5&deg;).

### Reading the angle

The angle always lands between 0&deg; and 180&deg;. An angle of 0&deg; means the vectors point the same way, 90&deg; means they are perpendicular, and 180&deg; means they point in opposite directions. Values below 90&deg; indicate the vectors generally agree in direction (positive dot product); values above 90&deg; indicate they mostly oppose each other (negative dot product).

| Vector a | Vector b | Dot product | Angle |
| --- | --- | --- | --- |
| (1, 0, 0) | (2, 0, 0) | 2 | 0&deg; |
| (1, 0, 0) | (0, 1, 0) | 0 | 90&deg; |
| (1, 1, 0) | (1, 0, 0) | 1 | 45&deg; |
| (1, 2, 2) | (3, 0, 1) | 5 | 58.19&deg; |
| (2, 0, 0) | (−3, 0, 0) | −6 | 180&deg; |

#### Perpendicularity in one multiplication

The 45&deg; row is worth memorizing: any vector with equal x and y components makes 45&deg; with the x axis, because cos 45&deg; = 1 ÷ &radic;2 ≈ 0.707. The last row shows that opposite directions force the cosine to −1 regardless of the lengths involved. Perpendicularity itself needs no arccos at all — two vectors are perpendicular exactly when their dot product is 0, which is why graphics code tests the dot product directly instead of computing the angle.

### Where the angle formula is used

- Cosine similarity in machine learning, where embedding vectors are compared by cos &theta; instead of distance
- Physics, where work is W = |F| × |d| × cos &theta; — a force perpendicular to motion (90&deg;) does zero work
- Computer graphics, where the angle between a surface normal and the light direction controls shading
- Geometry, where a perpendicularity check reduces to testing whether the dot product equals 0

#### Cosine similarity and embeddings

Cosine similarity deserves a note: it is exactly cos &theta; from this calculator, used as a similarity score from −1 (opposite) to +1 (identical direction). Two text embeddings with a cosine similarity of 0.85 correspond to an angle of arccos(0.85) ≈ 31.8&deg;. Converting between similarity and angle confuses many data-science students, and this calculator performs the conversion directly.

### Common mistakes

- Entering the zero vector, which has no direction; the calculator returns 90&deg; as a placeholder, but no angle truly exists
- Expecting angles beyond 180&deg; — the dot product cannot distinguish an angle from its supplement, so readings past 180&deg; are impossible
- Mixing up components when computing the dot product by hand; the terms must pair ax with bx, ay with by and az with bz
- Forgetting radians: 90&deg; equals about 1.571 radians, and trig functions in most programming languages expect radians
- Rounding too early in the cosine step, which can shift the final angle by a degree or more

## FAQ

### What is the range of the angle?

The angle always falls between 0&deg; and 180&deg; (0 and about 3.1416 radians) because the dot product cannot distinguish an angle from its supplement.

### Why does the calculator clamp the cosine?

Floating-point rounding can push the ratio slightly outside [−1, 1], which would make arccos return an error, so the value is clamped to the valid range before the angle is computed.

### What happens if one vector is the zero vector?

The angle is undefined because a zero vector has no direction. The calculator returns 90&deg; in that case as a placeholder rather than crashing.

### What angle do the default vectors give?

The defaults (1, 0, 0) and (0, 1, 0) have a dot product of 0, so the angle is exactly 90&deg;, or about 1.571 radians.

### Do the vector lengths change the angle?

No. Only direction matters: (1, 0, 0) and (0, 100, 0) still meet at 90&deg;, because the lengths cancel out in the cosine formula.

### How do I convert the angle to radians?

Multiply degrees by &pi; ÷ 180. The calculator reports both values: 90&deg; is about 1.571 radians, and 58.19&deg; is about 1.016 radians.

### How is this related to cosine similarity?

Cosine similarity is exactly cos &theta; from this formula. A similarity of 0.85 corresponds to an angle of about 31.8&deg;, and a similarity of 0 means the vectors are perpendicular.

### Why does a perpendicular force do no work in physics?

Work is W = |F| × |d| × cos &theta;, and cos 90&deg; = 0. A force at right angles to the motion transfers no energy, which is why carrying a box horizontally does no work against gravity.

### What angle corresponds to a cosine of 0.5?

Exactly 60&deg;, or about 1.047 radians. Other anchors worth memorizing are 0.866 for 30&deg;, 0.707 for 45&deg; and 0 for 90&deg;.

### Why do cosine similarities compress near 1?

Arccos is steep near 1: a similarity of 0.95 is an angle of 18.2&deg; while 0.98 is only 11.5&deg;, so tiny similarity differences near 1 represent large angular changes.

## Method and sources

Methodology: Results follow exact mathematical definitions; the arithmetic is deterministic and can be verified by hand from the steps shown.

Last updated: 2026-11-18.
- Angle formula cos &theta; = (a&middot;b) / (|a||b|).
