Calculate initial bearing (or forward azimuth/direction) to go
from point a
to point b
following great circle arc on a
sphere.
Details
get_azimuth()
is based on the spherical law of tangents.
This formula is for the initial bearing (sometimes referred to as
forward azimuth) which if followed in a straight line along a great circle
arc will lead from the start point a
to the end point b
.
$$\theta = \arctan2 (\sin \Delta\lambda
\cos\psi_2, \cos\psi_1 \sin\psi_1-\sin\psi_1 \cos\psi_2 \cos\Delta\lambda)$$
where \(\psi_1, \lambda_1\) is the start point, \(\psi_2\),
\(\lambda_2\) the end point (\(\Delta\lambda\) is the difference in
longitude).