GreatCircle.NET - which is based on the amazing work of Chris Veness, the owner
of the Geodesy functions project - provides a comprehensive set of extension methods to the BasicGeoposition
struct that
make working with GPS locations and performing calculations on then simple and easy.
(For a more general introduction, see: Movable Type Scripts Latitude / Longitude Calculations Reference)
Thus far, I have worked on porting the spherical-earth model, which provides simple formulae covering the accuracy requirements of most use cases.
GreatCircle.NET should be used via NuGet dependency manager.
Calculates the cross track distance of this position relative to the specified start position and end position.
The cross track distance of this position relative to the specified start position and end position.
Name | Type | Description |
---|---|---|
thisPosition | BasicGeoposition | This position. |
startPosition | BasicGeoposition | The start position. |
endPosititon | BasicGeoposition | The end position. |
Calculates a position representing the cross track point of this location relative to the specified start position and end position.
A position representing the cross track point of this location relative to the specified start position and end position.
Name | Type | Description |
---|---|---|
thisPosition | BasicGeoposition | This position. |
startPosition | BasicGeoposition | The start position. |
endPosititon | BasicGeoposition | The end position. |
Calculates the distance (in meters) between this position and the other position.
The distance (in meters) between this position and the other position.
Name | Type | Description |
---|---|---|
thisPosition | BasicGeoposition | This position. |
position | BasicGeoposition | The other position. |
Compares this position to the other position for equality.
true, if the positions are the same; otherwise, false.
Name | Type | Description |
---|---|---|
thisPosition | BasicGeoposition | This position. |
position | BasicGeoposition | The other position. |
includeAltitude | System.Boolean | A value which indicates whether to include altitude in the comparison. |
Calculates the final bearing (in degrees) between this position and the other position.
The final bearing (in degrees) between this position and the other position.
Name | Type | Description |
---|---|---|
thisPosition | BasicGeoposition | This position. |
position | BasicGeoposition | The other position. |
The final bearing will differ from the initial bearing by varying degrees according to distance and latitude.
Calculates the initial bearing (in degrees) between this position and the other position.
The initial bearing (in degrees) between this position and the other position.
Name | Type | Description |
---|---|---|
thisPosition | BasicGeoposition | This position. |
position | BasicGeoposition | The other position. |
Calculates a location representing the point of intersection of two paths, each specified by a location and bearing.
A location representing the point of intersection of two paths, each specified by a location and bearing.
Name | Type | Description |
---|---|---|
position1 | BasicGeoposition | The first position. |
bearing1 | System.Double | The first bearing. |
position2 | BasicGeoposition | The second position. |
bearing2 | System.Double | The second bearing. |
Calculates a position representing the point that lies at the specified bearing and distance from this position.
A position representing the point that lies at the specified bearing and distance from this position.
Name | Type | Description |
---|---|---|
thisPosition | BasicGeoposition | This position. |
bearing | System.Double | The bearing. |
distance | System.Double | The distance. |
Calculates a position representing the midpoint between this position and the other position.
A position representing the midpoint between this position and the other position.
Name | Type | Description |
---|---|---|
thisPosition | BasicGeoposition | This position. |
position | BasicGeoposition | The other position. |
GreatCircle is a work in progress and your contributions are most welcome. Feel free to fork the repo and submit PR's.
GreatCircle is released under the MIT License.