GitHub - tdjastrzebski/Vincenty-Excel: Thaddeus Vincenty's Direct and Inverse formulae for geodesic calculations in Excel (distance, azimuth, latitude, longitude). (original) (raw)

Vincenty's Direct and Inverse Solution of Geodesics on the Ellipsoid - Excel VBA implementation

to calculate new coordinate based on azimuth and distance (direct) or distance and azimuth based on two coordinates (inverse)

Algorithms by Thaddeus Vincenty (1975)
Based on the implementation in Java Script by Chris Veness
https://www.movable-type.co.uk/scripts/latlong-vincenty.html
https://github.com/chrisveness/geodesy

To make the long story short, I was looking for a way to calculate coordinates, distance and azimuth in Excel. I checked out several available solutions but they were either incomplete, did not work or results were inaccurate. That is how I ended up developing my own, complete Vincenty's Direct and Inverse formulae implementation.

Excel screenshot

How to use it?

Excel files

Implementation

Solution contains 6 functions implementing Vincenty's Direct and Vincenty's Inverse formulae as well as 2 functions for Decimal ↔ Degrees/Minutes/Seconds format conversion, and uses WGS84 model.

Most function arguments and return values are 64-bit high precision. In VBA Double data type denotes 64-bit floating-point number, regardless of Excel edition (32/64 bit).

Support functions

PL-2000 translation functions

Source code

Excel workbooks contain unprotected source code. In addition, for better change tracking, source code has been placed separately in Vincenty.bas file. This file is all what is required to add implemented functions to any other Excel workbook.

Validation

Calculation results have been validated using 1200 test cases generated for 6 range clusters and distance between 10 m and 30,000 km against GeographicLib by Charles Karney:

and Geoscience Australia website

Validation results - maximum deviation

| | GeographicLib | Geoscience Australia | | | --------------------------------- | -------------------- | ------- | | VincentyDirLat [degrees] | 1.11E-9 | 3.96E-8 | | VincentyDirLon [degees] | 6.54E-9 | 2.88E-7 | | VincentyDirRevAzimuth [degrees] | 6.54E-9 | 5.05E-7 | | VincentyInvDistance [mm] | 0.07240 | 0.53655 | | VincentyInvFwdAzimuth [degrees] | 1.46E-6 | 1.46E-6 | | VincentyInvRevAzimuth [degrees] | 1.46E-6 | 1.47E-6 |

Conclusions

I was only able to compare the achieved results with Geoscience Australia and GeographicLib, which is believed to be very accurate. I am not aware of substantially better references available publicly.

For complete test results refer to VincentyTest.xlsm file.

References

Feedback

Finally, if you find this tool useful please give it a star. This way others will be able to find it more easily. Do not hesitate leave comments/suggestions.