Understanding the Angle Between Two Vectors
The angle between two vectors is a fundamental concept in linear algebra and vector geometry. It measures how much two vectors diverge from each other in space, and is calculated using the dot product formula.
The Dot Product Formula
The dot product (also called the scalar product) of two vectors u and v is defined as:
u · v = u₁v₁ + u₂v₂ + u₃v₃ (for 3D vectors)
Geometrically: u · v = |u| · |v| · cos(θ)
Geometrically: u · v = |u| · |v| · cos(θ)
By rearranging, we obtain the formula for the angle:
θ = arccos[(u · v) / (|u| · |v|)]
Vector Magnitudes
The magnitude (or length) of a vector is calculated using the Pythagorean theorem extended to n dimensions:
|u| = sqrt(u₁² + u₂² + u₃²)
Perpendicular and Parallel Vectors
- Perpendicular (Orthogonal): When θ = 90°, the dot product equals zero.
- Parallel (Same Direction): When θ = 0°, cos(θ) = 1.
- Anti-parallel (Opposite): When θ = 180°, cos(θ) = -1.
- Acute: When 0 < θ < 90°, the dot product is positive.
- Obtuse: When 90 < θ < 180°, the dot product is negative.
Common Angle Values
| Angle (Degrees) | Angle (Radians) | cos(θ) | Relationship |
|---|---|---|---|
| 0° | 0 | 1 | Parallel (same direction) |
| 30° | π/6 | √3/2 ≈ 0.866 | Acute |
| 45° | π/4 | √2/2 ≈ 0.707 | Acute |
| 60° | π/3 | 0.5 | Acute |
| 90° | π/2 | 0 | Perpendicular |
| 120° | 2π/3 | -0.5 | Obtuse |
| 180° | π | -1 | Anti-parallel |
Applications
- Physics: Work done by a force (W = F · d · cosθ), resolving vector components.
- Computer Graphics: Lighting calculations use the angle between surface normals and light direction vectors.
- Machine Learning: Cosine similarity measures how similar two feature vectors are.
- Navigation: Determining course correction angles between heading and destination vectors.
- Engineering: Structural analysis requires computing angles between force vectors.
Cross Product (3D Only)
For 3D vectors, the cross product provides an alternative relationship:
|u × v| = |u| · |v| · sin(θ)
The cross product produces a vector perpendicular to both input vectors, with magnitude related to the sine of the angle between them.