-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
7 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,25 +6,26 @@ The inverse geodesic problem must be solved to compute the distance between two | |
ellipsoid in general. The generalization to ellipsoids, which are not oblate spheroids is not further considered here, | ||
hence the term ellipsoid will be used synonymous with oblate spheroid. | ||
|
||
The distance between two points is also know as the | ||
The distance between two points is also known as the | ||
[Vincenty distance](https://en.wikipedia.org/wiki/Vincenty's_formulae). | ||
|
||
Here is an example to compute the distance between two points (the poles in this case) on the | ||
[WGS 84 ellipsoid](https://en.wikipedia.org/wiki/World_Geodetic_System). | ||
|
||
import geodesics | ||
let d = try distance((lat: Double.pi / 2,lon: 0), (lat: -Double.pi / 2, lon: 0)) | ||
let d = distance((lat: Double.pi / 2,lon: 0), (lat: -Double.pi / 2, lon: 0)) | ||
|
||
and that it. | ||
and that's it. | ||
|
||
# Implementation Details | ||
## Implementation Details | ||
|
||
This Swift package is a wrapper for the | ||
[C library for Geodesics 1.49](https://geographiclib.sourceforge.io/html/C/). | ||
The author of this library is Charles F. F. Karney ([email protected]). | ||
The goal of this Swift package is to make some algorithms from | ||
[GeographicLib](https://geographiclib.sourceforge.io/) available to the Swift world. | ||
Alternatively one can employ the [vincenty](https://github.com/dastrobu/vincenty) | ||
Alternatively one can employ the package | ||
[vincenty](https://github.com/dastrobu/vincenty) | ||
which is a much simpler solver for the inverse geodesic problem, completely written in | ||
Swift. Vincenty's formulae does, however, have some convergence problems in rare | ||
cases, an may not give the same accuracy as Karney's algorithm. | ||
|
@@ -39,7 +40,7 @@ See documentation of [GeographicLib](https://geographiclib.sourceforge.io/) for | |
By default the | ||
[WGS 84 ellipsoid](https://en.wikipedia.org/wiki/World_Geodetic_System) | ||
is employed, but different parameters can be specified, e.g. for the | ||
[GRS 80 ellipsoid](https://en.wikipedia.org/wiki/GRS_80) | ||
[GRS 80 ellipsoid](https://en.wikipedia.org/wiki/GRS_80). | ||
|
||
distance((lat: Double.pi / 2, lon: 0), (lat: -Double.pi / 2, lon: 0), | ||
ellipsoid (a: 6378137.0, f: 1/298.257222100882711)) | ||
|