Find the angle between two vectors in 2D–6D using the dot product formula. Get degrees, radians, cos/sin/tan θ, perpendicularity and parallelism checks, computation steps, and a visual angle gauge.
The angle between two vectors is one of the most frequently needed quantities in linear algebra, physics, and computer science. Given vectors a and b, the angle θ is found using the dot product relationship: cos θ = (a · b) / (‖a‖ ‖b‖). Taking the inverse cosine yields the angle in radians, easily converted to degrees by multiplying by 180/π.
This formula works in any number of dimensions — whether you are measuring the heading difference between two 2D velocity vectors, the angle between 3D surface normals, or the similarity of high-dimensional feature vectors in machine learning. The angle is always between 0° (parallel) and 180° (anti-parallel), with 90° indicating orthogonal vectors.
This calculator supports vectors from 2D up to 6D. Enter components for both vectors, or load one of six presets that cover key cases: a 45° pair, a 90° orthogonal pair, a 60° pair, an anti-parallel pair, and two general 3D examples. The output cards show the angle in degrees and radians, cos θ, sin θ, tan θ, the dot product, magnitudes, and an automatic classification as acute, right, or obtuse.
A color-coded angle gauge visualizes where the result falls on the 0°–180° scale, and a step-by-step computation table shows every intermediate value so you can verify or study the process. Reference and component-wise product tables round out the tool.
Understanding vector angles is critical for lighting in 3D graphics (Lambert's cosine law), navigation (bearing differences), robotics (joint angles), and data science (cosine similarity between document or embedding vectors).
Finding the angle between vectors requires computing dot products, magnitudes (with square roots), dividing, and applying the inverse cosine — a multi-step process where a single arithmetic slip produces a wrong angle. For higher-dimensional vectors (4D–6D), the computation grows even longer. This calculator instantly shows the angle in both degrees and radians, classifies it as acute, right, or obtuse, reports cos/sin/tan θ, and checks orthogonality and parallelism. It is essential for physics students computing angles between forces, graphics programmers checking surface normals, and data scientists evaluating cosine similarity between feature vectors.
cos θ = (a · b) / (‖a‖ · ‖b‖); θ = cos⁻¹(cos θ)
Result: θ = 45°
a · b = 1. ‖a‖ = 1, ‖b‖ = √2 ≈ 1.4142. cos θ = 1/√2 ≈ 0.7071. θ = cos⁻¹(0.7071) = 45° (π/4 rad). This is an acute angle.
The angle θ between vectors **a** and **b** is derived from the dot product identity: cos θ = (a · b) / (‖a‖ ‖b‖). The dot product a · b = Σ aᵢbᵢ sums the component-wise products, while ‖a‖ = √(Σ aᵢ²) is the Euclidean norm. Because the inverse cosine function returns values in [0, π], the angle is always between 0° (parallel) and 180° (anti-parallel). This formula generalizes seamlessly from 2D to any number of dimensions — the geometry of angles is dimension-independent.
An angle of exactly 90° (cos θ = 0) means the vectors are **orthogonal** — their dot product is zero, which is the fastest perpendicularity test. Angles below 90° (positive dot product) are **acute**, meaning the vectors point in roughly the same direction. Angles above 90° (negative dot product) are **obtuse**, meaning they diverge. When cos θ = ±1, the vectors are parallel or anti-parallel. Recognizing these cases is crucial in physics (work = F·d·cos θ is zero for perpendicular force and displacement) and in machine learning (cosine similarity near 1 indicates highly similar vectors).
In **3D graphics**, the angle between a surface normal and a light direction vector determines shading intensity via Lambert's cosine law. In **robotics**, joint angles between link vectors control arm positioning. In **NLP and recommendation systems**, cosine similarity (the normalized dot product) measures how closely two document or user-preference vectors align, regardless of their magnitudes. In **navigation**, the angle between velocity and heading vectors reveals course deviation. Understanding how to compute and interpret vector angles is fundamental across all quantitative disciplines.
Compute cos θ = (a · b) / (‖a‖ ‖b‖), then take the inverse cosine. The result is in radians; multiply by 180/π for degrees.
The vectors point in exactly the same direction (they are parallel). Their dot product equals the product of their magnitudes.
No. The formula cos⁻¹ always returns a value between 0° and 180°. For signed angles in 2D, use atan2 instead.
90° (π/2 radians). Their dot product is zero because cos 90° = 0.
Yes. The dot product and Euclidean norm generalize to any number of dimensions, so the angle formula works identically in 2D, 3D, 100D, etc.
Cosine similarity is cos θ = (a · b) / (‖a‖ ‖b‖). It measures directional similarity on a scale from −1 (opposite) to 1 (identical direction), ignoring magnitudes.