MATLAB implementations of a subset of the C++ library, GeographicLib


Updated 21 Apr 2022

View License

GeographicLib toolbox
Version 2.0 2022-04-21
This toolbox provides native MATLAB implementations of a subset of the C++ library, GeographicLib. Full documentation is available at

Cite As

Charles Karney (2023). geographiclib (, MATLAB Central File Exchange. Retrieved .

Karney, Charles F. F. “Algorithms for Geodesics.” Journal of Geodesy, vol. 87, no. 1, Springer Science and Business Media LLC, June 2012, pp. 43–55, doi:10.1007/s00190-012-0578-z.

View more styles
MATLAB Release Compatibility
Created with R2014b
Compatible with any release
Platform Compatibility
Windows macOS Linux

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!
Version Published Release Notes

A bug fix, better vectorization in geodreckon; better treatment of +/-0. For details, see


geoddistance: be more aggressive in preventing negative s12 and m12 for short lines.


geodarea can now handle arbitrarily complex polygons.
Fix bug in mgrs_inv which resulted in incorrect results for UPS zones with prec = -1.
In geodreckon.m and geoddistance.m, suppress (innocuous) "warning: division by zero" messages from Octave.


Update to version 1.49

Fix BUGS in geodreckon with mixed scalar and array arguments.
Default range for longitude and azimuth is (-180d, 180d].

Improve accuracy of area calculation (fixing a flaw introduced in version 1.46).
Fix vectorization of copysignx for MATLAB (Octave was already OK).

Improve the accuracy of the solution of the inverse problem when the
longitude difference is close to 180deg.

Synchronize with GeographicLib 1.45.
tranmerc_{fwd,inv} works with mixed scalar+array args.
couple of Octave-specific fixes.
array mismatch fix for geoddistance

Fix obscure bug in geoddistance (apply to Octave only).

Synchronize with GeographicLib 1.44.

Synchronize with GeographicLib 1.43.
Fix bug in the long_unroll feature of geodreckon.
mgrs_inv now takes an optional center argument.

Version 1.42.1 Repackage as a toolbox to eliminate spurious dependency. No change in .m files.

Reverting to zip packaging. MATLAB Central produces a garbled zip file
when submitting a mltbx file.

Sync with GeographicLib 1.42. Minor changes to documentation only.

Remove bogus dependency on Robust Control Toolbox (yet again!).

Remove bogus dependency on Robust Control Toolbox (again!).

Remove bogus required product.