Sum of corresponding component products.
Mathematics · Vectors & matrices
Dot product and angle between vectors calculator
Find the dot product, vector norms, cosine and angle between two 2D or 3D vectors.
Created v1.0
By Thibaut Grzelak, Mechanical Analysis Engineer
Results
Angle in degrees; undefined for a zero direction.
Results show up to four significant digits for readability; internal calculations retain full precision.
See calculation details
01Norm of A
‖A‖ = √(∑ᵢ Aᵢ²)√(1² + 0²)02Norm of B
‖B‖ = √(∑ᵢ Bᵢ²)√(0² + 1²)03Dot product
A·B = ∑ᵢ AᵢBᵢ1 × 0 + 0 × 104Cosine of θ
cos θ = (A·B)/(‖A‖‖B‖)0 / (1 × 1)05Angle θ
θ = arccos(cos θ)arccos(0) × 180°/π01Formulas and symbols
Formulas used
A·B = ∑ AᵢBᵢ
cos θ = (A·B)/(‖A‖‖B‖)
A·B: dot product; θ: angle; ‖A‖ and ‖B‖: norms.
| Symbol | Meaning |
|---|---|
| d | Dimension |
| Aₓ | Vector A — ₓ |
| Aᵧ | Vector A — ᵧ |
| A_z | Vector A — 𝓏 |
| Bₓ | Vector B — ₓ |
| Bᵧ | Vector B — ᵧ |
| B_z | Vector B — 𝓏 |
| A·B | Dot product |
| ‖A‖ | Norm of A |
| ‖B‖ | Norm of B |
| cos θ | Cosine of θ |
| θ | Angle θ |
02Validation example
Reference numerical case
- A = (1, 0), B = (0, 1): A·B = 0, norms 1, cos θ = 0 and θ = 90°.
03How it works
The dot product sums component products. Dividing by both norms gives the cosine of the angle from 0° to 180°. The cosine is clamped to [−1, 1] only to contain floating-point round-off.
04Limits and conventions
Both vectors use the same dimension and orthonormal axes. With a zero vector the dot product is zero, but the angle and its cosine are undefined. A projected 3D drawing cannot show the true spatial angle.
05Common mistakes
A positive dot product means an acute angle, a negative one an obtuse angle. Perpendicular nonzero vectors have a zero dot product.
06Practical questions
What does a zero dot product mean geometrically?
For two nonzero vectors, A·B = 0 means they are perpendicular because A·B = ‖A‖‖B‖cosθ. A zero vector is a special case because its direction and angle are undefined.
How can the dot product be used to find the angle between vectors?
For two nonzero vectors, compute cosθ = (A·B)/(‖A‖‖B‖), then θ = arccos(cosθ). The result lies between 0° and 180°.