Calculate the angle between two vectors in 2D or 3D space using the dot product formula. Visualize vectors on a 2D canvas, get step‑by‑step reasoning, dot product, magnitudes, cosine similarity, and the geometric interpretation.
The angle between two vectors A and B is derived from the dot product formula: A · B = |A||B| cos θ. Therefore, θ = arccos( (A·B) / (|A||B|) ), where θ ∈ [0°, 180°]. This fundamental relation connects algebraic operations to geometric intuition. The dot product in ℝⁿ is computed as sum of component‑wise products: A·B = Σ aᵢbᵢ.
$$\cos \theta = \frac{\mathbf{A} \cdot \mathbf{B}}{\|\mathbf{A}\| \|\mathbf{B}\|} = \frac{a_x b_x + a_y b_y + a_z b_z}{\sqrt{a_x^2+a_y^2+a_z^2} \cdot \sqrt{b_x^2+b_y^2+b_z^2}}$$
This identity appears in countless disciplines: cosine similarity in data science (measures document similarity), work W = F·d in physics, lighting computations in computer graphics (Lambertian reflectance), and orthogonal projections in engineering.
In text mining and recommendation engines, documents are represented as high‑dimensional vectors (TF-IDF). Cosine similarity between vectors gives a measure of orientation, ignoring magnitude. Two documents with similar content have an angle close to 0° (cosine ≈ 1). Our calculator above provides the same core metric — essential for data scientists and AI engineers.
Work done by a constant force is W = F·d = |F||d| cosθ. Using our vector angle calculator, students can instantly find the angle between force and displacement vectors, validate experimental data, or solve inclined‑plane problems. The interactive graph clarifies why zero work occurs when θ = 90°.
Shading models rely on the angle between light direction and surface normals. The Lambertian diffuse term max(0, N·L) uses dot product; this calculator helps debug 3D scenes, compute angles between camera and object vectors, and implement collision detection.
| Condition | Angle (θ) | Dot Product | Example Vectors (2D) |
|---|---|---|---|
| Parallel (same direction) | 0° | |A||B| | (3,0) , (6,0) |
| Perpendicular (orthogonal) | 90° | 0 | (2,0) , (0,5) |
| Acute | 0° < θ < 90° | positive | (4,1) , (2,3) |
| Obtuse | 90° < θ < 180° | negative | (-2,3) , (4,1) |
| Antiparallel | 180° | -|A||B| | (1,2) , (-2,-4) |
The concept of vectors and dot product emerged in the 19th century with Josiah Willard Gibbs and Oliver Heaviside. The geometric interpretation of cosine via dot product revolutionized physics and engineering. Hermann Grassmann's work laid the foundation for modern linear algebra. Today, the angle between vectors is a cornerstone of principal component analysis (PCA), correlation coefficients (cosine similarity equals Pearson correlation for centered vectors), and orthogonal frequency division multiplexing (OFDM) in telecommunications.