GEODESIC(3) - Linux manual page online | Library functions
Initialize an ellipsoid.
Chapters
2016/02/16 Rel. 4.9.3
GEODESIC(3) Library Functions Manual GEODESIC(3)
2016/02/16 Rel. 4.9.3 GEODESIC(3)
NAME
geod_init - initialize an ellipsoid geod_direct geod_gendirect - the direct geodesic problem geod_inverse geod_geninverse - the inverse geodesic problem geod_lineinit geod_directline geod_gendirectline geod_inverse‐ line - initialize a geodesic line geod_setdistance geod_gensetdistance - set distance to refer‐ ence point geod_position geod_genposition - a position on a geodesic line geod_polygon_init - initialize a polygon geod_addpoint geod_addedge - add to a polygon geod_polygon_compute geod_polygon_testpoint geod_polygon_test‐ edge - compute properties of polygon geod_polygon_clear - clear polygon geod_polygonarea - the area of a polygonSYNOPSIS
#include <geodesic.h> and link against the proj library.DESCRIPTION
This library is a port of the geodesic routines in the C++ li‐ brary, GeographicLib, to C. It solves the direct and inverse geodesic problems on an ellipsoid of revolution. In addition, the reduced length of a geodesic and the area between a geodes‐ ic and the equator can be computed. The results are accurate to round off for |f| < 1/50, where f is the flattening. Note that the geodesic routines measure angles (latitudes, longi‐ tudes, and azimuths) in degrees, unlike the rest of the proj library, which uses radians. The documentation for this li‐ brary is included in geodesic.h. A formatted version of the documentation is available at http://geographi‐ clib.sf.net/1.46/CEXAMPLE
The following program reads in lines with the coordinates for two points in decimal degrees (lat1, lon1, lat2, lon2) and prints out azi1, azi2, s12 for the geodesic line between each pair of points on the WGS84 ellipsoid. (N.B. azi2 is the for‐ ward azimuth at point 2.) #include <stdio.h> #include <geodesic.h> int main() { double a = 6378137, f = 1/298.257223563; /* WGS84 */ double lat1, lon1, azi1, lat2, lon2, azi2, s12; struct geod_geodesic g; geod_init(&g, a, f); while (scanf("%lf %lf %lf %lf", &lat1, &lon1, &lat2, &lon2) == 4) { geod_inverse(&g, lat1, lon1, lat2, lon2, &s12, &azi1, &azi2); printf("%.8f %.8f %.3f\n", azi1, azi2, s12); } return 0; }LIBRARY
libproj.a - library of projections and support proceduresSEE ALSO
Full online documentation for geodesic(3), http://geographiclib.sf.net/1.46/C geod(1) GeographicLib, http://geographiclib.sf.net The GeodesicExact class in GeographicLib solves the geodesic problems in terms of elliptic integrals; the results are accu‐ rate for arbitrary f. C. F. F. Karney, Algorithms for Geodesics, J. Geodesy 87, 43-55 (2013); DOI: http://dx.doi.org/10.1007/s00190-012-0578-z http://geographiclib.sf.net/geod-addenda.html A geodesic bibliography, http://geographiclib.sf.net/geodesic-papers/biblio.html The Wikipedia page, Geodesics on an ellipsoid, https://en.wikipedia.org/wiki/Geodesics_on_an_ellipsoidBUGS
A list of known bugs can found at https://github.com/OS‐ Geo/proj.4/issues where new bug reports can be submitted too.HOME PAGE
http://proj4.org/This manual | Reference | Other manuals |
---|---|---|
geodesic(3) | referred by | geod(1) |
refer to | geod(1) |