Implementation of geodesic routines in modern Fortran.
This is a library to solve geodesic problems on a planetary body (e.g., the Earth).
Some of the algorithms in this library:
Procedure | Body Shape | Description | Reference |
---|---|---|---|
cartesian_to_geodetic_triaxial | Triaxial | Cartesian to geodetic | Panou & Korakitis (2022) |
cartesian_to_geodetic_triaxial_2 | Triaxial | Cartesian to geodetic | Bektas (2015) |
heikkinen | Biaxial | Cartesian to geodetic | Heikkinen (1982) |
olson | Biaxial | Cartesian to geodetic | Olson (1996) |
direct | Biaxial | Direct geodesic problem | Karney (2013) |
direct_vincenty | Biaxial | Direct geodesic problem | Vincenty (1975) |
inverse | Biaxial | Inverse geodesic problem | Karney (2013) |
inverse_vincenty | Biaxial | Inverse geodesic problem | Vincenty (1975) |
great_circle_distance | Sphere | Great circle distance | Vincenty (1975) |
See the latest API documentation for the full list. This was generated from the source code using FORD (i.e. by running ford ford.md
).
A fpm.toml
file is provided for compiling geodesic-fortran with the Fortran Package Manager. For example, to build:
fpm build --profile release
By default, the library is built with double precision (real64
) real values. Explicitly specifying the real kind can be done using the following processor flags:
Preprocessor flag | Kind | Number of bytes |
---|---|---|
REAL32 |
real(kind=real32) |
4 |
REAL64 |
real(kind=real64) |
8 |
REAL128 |
real(kind=real128) |
16 |
For example, to build a single precision version of the library, use:
fpm build --profile release --flag "-DREAL32"
To run the unit tests:
fpm test --profile release
To use geodesic-fortran
within your fpm project, add the following to your fpm.toml
file:
[dependencies]
geodesic-fortran = { git="https://github.com/jacobwilliams/geodesic-fortran.git" }
or, to use a specific version:
[dependencies]
geodesic-fortran = { git="https://github.com/jacobwilliams/geodesic-fortran.git", tag = "1.0.0" }
- This library is licensed under a permissive MIT/X11/BSD license.
- T. Vincenty, "Direct and Inverse Solutions of Geodesics on the Ellipsoid with Application of Nested Equations", Survey Review XXII. 176, April 1975.
- C. F. F. Karney, Algorithms for geodesics, J. Geodesy 87(1), 43–55 (2013); Addenda.
- G. Panou and R. Korakitis, "Cartesian to geodetic coordinates conversion on an ellipsoid using the bisection method". Journal of Geodesy volume 96, Article number: 66 (2022).
- Gema Maria Diaz-Toca, Leandro Marin, Ioana Necula, "Direct transformation from Cartesian into geodetic coordinates on a triaxial ellipsoid", Computers & Geosciences, Volume 142, September 2020, 104551.
Geographiclib
documentation and git repository- Fortran Astrodynamics Toolkit
- FORWARD and INVERSE from the NGS