I found Calculating View Angle detailing how to calculate the elevation and azimuth measurements of a point B from a reference point A.
The elevation calculation works great - and I did some math to verify where the cos(elevation) equation was coming from. It implemented perfectly with the given example, too.
The azimuth is not so clear to me, and I cannot seem to derive the equations for the azimuth at all. When I implement it in MATLAB, it's also not producing the correct values.
I want the local azimuth measurement of point B with respect to point A's NED coordinate system.
How can I derive these equations or can someone explain the derivation for the equation on the linked post?