Documentation ¶
Overview ¶
This package provides forward and inverse geodesic calculations on the WGS84 ellipsoid.
The calculations are borrowed from the GeographicLib C++ library by Charles Karney. Its Geoid class is replaced by hardcoded WGS84 with the sperical harmonics computed to 8'th order. The forward function is lifted from the C++ code for GeodesicLine(lat1, lon1, azi1..).GenPosition(s12...) and it's dependents, the inverse function is Geodesic::GenInverse.
The documentation for the Original C++ classes can be found at
http://geographiclib.sourceforge.net/html/annotated.html
Index ¶
Constants ¶
const ( WGS84_a = 6378137. // Equatorial radius in meters WGS84_f = 1. / 298.25722210088 // Flattening of the ellipsoid )
Variables ¶
This section is empty.
Functions ¶
func Forward ¶
Compute the Point (lat2, lon2) obtained by following the geodesic line from (lat1,lon2) in the direction azi1 over a distance of s12 [meters] and the arriving azimuth azi2. All angles are in radians. Azimuths are clockwise from the North. Positive latitudes are North, positive longitudes are East. Unlike the C++ original, azi2 points in the incoming direction.
func Inverse ¶
Given two points (lat1, lon1) and (lat2, lon2), compute a geodesic between them, and return the distance in meters and the azimuths in both points. All angles are in radians. Azimuths are clockwise from the north. Positive latitudes are North, positive Longitudes are East. Unlike the C++ original, azi2 points in the incoming direction.
Types ¶
type GeodesicLine ¶
type GeodesicLine struct {
// contains filtered or unexported fields
}
A GeodesicLine represents a geodesic around the ellipsoid based in some point, under some azimuth.
func NewGeodesicLine ¶
func NewGeodesicLine(lat1, lon1, azi1 float64) *GeodesicLine
Construct an object representing a geodesic line through (lat1, lon1) at azimuth azi1. All angles are in radians. Azimuths are clockwise from the North. Positive latitudes are North, positive longitudes are East.
func (*GeodesicLine) Position ¶
func (g *GeodesicLine) Position(s12 float64) (lat2, lon2, azi2 float64)
Compute the Point (lat2,lon2) obtained by following the geodesic line from it's basepoint over a distance of s12 [meters] and the arriving azimuth azi2. All angles are in radians. Azimuths are clockwise from the North. Positive latitudes are North, positive longitudes are East. Unlike the C++ original, azi2 points in the incoming direction.