Figure 1:
Illustration of angle calculation.