Find the Angle Between Two Vectors — Dot Product & Magnitude
Calculate the angle between two vectors in 2D or 3D using the dot product formula θ = arccos((a·b)/(|a||b|)). Results in degrees or radians with step-by-step solutions.
Did our AI summary help? Let us know.
θ = arccos((v₁·v₂)/(|v₁||v₂|)) — angle from dot product and magnitudes Parallel vectors: θ = 0°, dot product = |v₁||v₂| Perpendicular vectors: θ = 90°, dot product = 0 Scaling vectors does not change the angle — only direction matters Cosine similarity in ML is exactly cos(θ) between feature vectors
Ready to run the numbers?
Why: Vector angles are fundamental in physics (work, force projection), computer graphics, machine learning (cosine similarity), and navigation. The dot product reveals how aligned two directions are.
How: The calculator computes dot product a·b, magnitudes |a| and |b|, then θ = arccos((a·b)/(|a||b|)). Works in 2D or 3D. cos θ is clamped to [-1,1] for numerical stability.
Run the calculator when you are ready.
Angle Between Vectors — 2D & 3D
Enter vector components and get the angle, dot product, and magnitudes. Works in degrees or radians.
↗ Sample Examples — Click to Load
Settings
Vector Components
Vector 1
Vector 2
Magnitudes & Dot Product
Angle in 180°
Vector Properties Radar
Step-by-Step Breakdown
For educational and informational purposes only. Verify with a qualified professional.
🧮 Fascinating Math Facts
Cosine similarity in ML is exactly cos(θ) between feature vectors — used in recommendation systems and NLP
— Khan Academy
Work W = F·d = |F||d|cos θ — the dot product gives the component of force along displacement
— MIT 18.022
Orthogonal vectors (θ=90°) have dot product zero — basis vectors in coordinate systems
— Wolfram MathWorld
The formula works in any dimension — 2D, 3D, or n-dimensional vectors
— Linear Algebra
Key Takeaways
- θ = arccos((v₁·v₂) / (|v₁||v₂|)) — angle from dot product and magnitudes
- Dot product: v₁·v₂ = aₓbₓ + aᵧbᵧ (+ aᵤbᵤ in 3D)
- Magnitude: |v| = √(vₓ² + vᵧ² + vᵤ²)
- Angle is always 0°–180° — parallel (0°), perpendicular (90°), opposite (180°)
- Scaling vectors does not change the angle — only direction matters
Did You Know?
How It Works
From a·b = |a||b|cos θ, solve for θ = arccos((a·b)/(|a||b|)).
Step 1: Dot Product
2D: aₓbₓ + aᵧbᵧ. 3D: add aᵤbᵤ.
Step 2: Magnitudes
|v| = √(vₓ² + vᵧ²) or √(vₓ² + vᵧ² + vᵤ²).
Step 3: cos θ
cos θ = (a·b) / (|a||b|). Clamp to [-1,1] for floating-point safety.
Step 4: θ
θ = arccos(...). Result in radians; multiply by 180/π for degrees.
Expert Tips
Zero Vector
If either vector has zero magnitude, the angle is undefined. The calculator will show an error.
Unit Vectors
For unit vectors (|v|=1), cos θ = v₁·v₂. The dot product directly gives cos of the angle.
Parallel vs Perpendicular
Parallel: dot product = |v₁||v₂| (θ=0°). Perpendicular: dot product = 0 (θ=90°).
Projection
proj_b(a) = (a·b/|b|²)b. The scalar (a·b)/|b| is |a|cos θ — component of a along b.
This Calculator vs Alternatives
| Feature | This Calculator | Manual |
|---|---|---|
| 2D & 3D | Both supported | Manual formula |
| Degrees/Radians | Toggle output | Convert manually |
| Step-by-step | Yes | No |
Frequently Asked Questions
Can the angle exceed 180°?
No. The angle between vectors is defined as the smaller angle, always 0°–180°.
What if a vector has zero magnitude?
The angle is undefined. Division by zero would occur. The calculator shows an error.
Does scaling change the angle?
No. θ depends only on direction. Multiplying a vector by a scalar does not change its direction.
How is this related to cosine similarity?
Cosine similarity = cos θ = (a·b)/(|a||b|). Same formula, used in ML for text/document similarity.
What about the cross product?
|a×b| = |a||b|sin θ. Dot product uses cos, cross product uses sin. Cross product is a vector; dot product is scalar.
Why clamp cos θ to [-1,1]?
Floating-point errors can produce values slightly outside [-1,1]. arccos requires input in that range.
Vector Angles by the Numbers
Official & Trusted Sources
Disclaimer: This calculator uses the standard dot product formula θ = arccos((a·b)/(|a||b|)). Results are for educational and general use. Zero vectors produce an error. For critical applications, verify with domain-specific tools.
Related Calculators
Central Angle Calculator
Central Angle Calculator - Calculate and learn about angle concepts
MathematicsClock Angle Calculator
Clock Angle Calculator - Calculate and learn about angle concepts
MathematicsCoterminal Angle Calculator
Coterminal Angle Calculator - Calculate and learn about angle concepts
MathematicsReference Angle Calculator
Reference Angle Calculator - Calculate and learn about angle concepts
MathematicsComplementary Angles Calculator
Complementary Angles Calculator - Calculate and learn about angle concepts
MathematicsSupplementary Angles Calculator
Supplementary Angles Calculator - Calculate and learn about angle concepts
Mathematics