Angle Between Vectors
Find the angle between two vectors from coordinates in 2D and 3D and the angle of a triangle from three points: exact cosine and the angle in degrees.
The angle between vectors calculator finds the cosine of the angle and the angle itself between two vectors from their coordinates in the plane and in space, as well as angle ABC of a triangle from the coordinates of three points. The cosine is written exactly (for example, −2√6/21), standard angles are exact (60°, 135°), others are in degrees to 0.0001.
Formula for the angle between vectors
cos φ = (a · b) / (|a| · |b|) = (x1x2 + y1y2 + z1z2) / (√(x1² + y1² + z1²) · √(x2² + y2² + z2²))
The angle between vectors is always from 0° to 180°.
Example 1. a = (1, 1, 0), b = (0, 1, 1).
a · b = 1, |a| = |b| = √2, cos φ = 1/2 ⇒ φ = 60°.
Example 2. Angle ABC: A(1, 0), B(0, 0), C(1, 1).
BA = (1, 0), BC = (1, 1), cos ∠B = 1/√2 = √2/2 ⇒ ∠ABC = 45°.
The type of angle without calculation
| Dot product | Angle |
|---|---|
| > 0 | acute (0° ≤ φ < 90°) |
| = 0 | right — the vectors are perpendicular |
| < 0 | obtuse (90° < φ ≤ 180°) |
If the vectors point the same way, the angle is 0°; if they point in opposite directions, it is 180°. For a zero vector the angle is undefined.
Linked Calculators
Comments
No comments yet.