Hello everyone.

I’m trying to create a simple excel formula to calculate the azimuth between two points at sphere based on GPS/WGS84 coordinates.

I made some simplifications:

1. Earth is a sphere.

2. Ellipsoidal WGS84 coordinates can be used for a sphere without recalculations.

3. Carthesian trigonometry is allowed for small distances.

When calculating an angle in carthesian trigonometry the arctangent function is used. Excel formula =atan2(x_num;y_num) would return the the “m” gradient of y=mx+b function (counterclockwise, from 0→X direction). The azimuth is actually clockwise, from 0→Y direction, so the formula should be =[PI()/2]-[atan2(x_num;y_num)] or simply with X,Y swapped =atan2(y_num;x_num).

WGS 84 coordinates are presented on a plane with equirectangular projection. Meridians have no distortion [dY=dφ], while parallels are lengthened with a 1/cosφ factor [dX=dλ*(1/cosφ)]. I think that all you have to do to create sphere-like azimuth is to get rid of that dX distortion. The azimuth formula from point 1 (X1,Y1) to point 2 (X2, Y2) would be =atan2[(Y2-Y1);(X2-X1)*cosY2]. It works quite well and calculated with =degree() returns values ranged -180

More Jakub Andrzej Kuna's questions See All
Similar questions and discussions