We will begin by deriving the formula for \(\cos\left(A + B \right)\) using the unit circle.
Consider the two points \(P\) and \(Q\) on the unit circle, where \(P\) is defined by \(\left( \cos(\theta) , \sin(\theta) \right)\) for some angle \(\theta\), \(\theta \gt 0\) and \(Q\) is given by \(\left(\cos(-\beta) , \sin(-\beta)\right)\) for some angle \(\beta\), \(\beta \gt 0\). The coordinates of \(Q\) can be simplified to \(\left(\cos(\beta) , -\sin(\beta)\right)\).
The measure of \(\angle POQ\), with \(O\) at the origin, is \(\theta + \beta\).
The length of the line segment \(PQ\) can be found using
\[\lvert PQ \rvert = \sqrt{(\Delta x)^2 + (\Delta y)^2}\]