# Angle Between Vectors

The angle between two nonzero vectors \(a\), \(b\) is defined as \[\theta = \text{arccos} \bigg( \frac{a^Tb}{||a|| \ ||b||} \bigg)\] where arccos denotes the inverse cosine, normalized to lie in the interval \([0, \pi]\). In other words, we define \(\theta\) as the unique number between 0 and \(\pi\) that satisfies \[a^Tb = ||a|| \ ||b|| \ \text{cos} \ \theta\] The angle between \(a\) and \(b\) is written as \(\angle(a, b)\), and is sometimes expressed in degrees (the default unit is radians). …