~ubuntu-branches/ubuntu/wily/proj/wily

« back to all changes in this revision

Viewing changes to man/man3/geodesic.3

  • Committer: Package Import Robot
  • Author(s): Bas Couwenberg
  • Date: 2015-05-03 21:15:10 UTC
  • mfrom: (12.1.4 experimental)
  • Revision ID: package-import@ubuntu.com-20150503211510-35jung6npvio2e5k
Tags: 4.9.1-1
* Move from experimental to unstable.
* Use jquery.js from libjs-jquery instead of doxygen copy.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
.\" @(#)geodesic.3
 
2
.nr LL 7.0i
 
3
.TH GEODESIC 3 "2014/12/17 Rel. 4.9.0" 
 
4
.ad b
 
5
.hy 1
 
6
.SH NAME
 
7
.B geod_init
 
8
\- initialize an ellipsoid
 
9
.br
 
10
.B geod_lineinit
 
11
\- initialize a geodesic line
 
12
.br
 
13
.B geod_position
 
14
\- a position on a geodesic line
 
15
.br
 
16
.B geod_direct
 
17
\- the direct geodesic problem
 
18
.br
 
19
.B geod_inverse
 
20
\- the inverse geodesic problem
 
21
.br
 
22
.B geod_polygonarea
 
23
\- the area of a polygon
 
24
.br
 
25
.SH SYNOPSIS
 
26
.nf
 
27
#include <geodesic.h>
 
28
.br
 
29
and link against the \fBproj\fR library.
 
30
.SH DESCRIPTION
 
31
This library is a port of the geodesic routines in the C++ library,
 
32
GeographicLib, to C.  It solves the direct and inverse geodesic problems
 
33
on an ellipsoid of revolution.  In addition, the reduced length of a
 
34
geodesic and the area between a geodesic and the equator can be
 
35
computed.  The results are accurate to round off for |\fIf\fR| < 1/50,
 
36
where \fIf\fR is the flattening.  Note that the geodesic routines
 
37
measure angles (latitudes, longitudes, and azimuths) in degrees, unlike
 
38
the rest of the \fBproj\fR library, which uses radians.  The
 
39
documentation for this library is included in geodesic.h.  A formatted
 
40
version of the documentation is available at
 
41
http://geographiclib.sf.net/1.40/C
 
42
.SH EXAMPLE
 
43
The following program reads in lines with the coordinates for two points
 
44
in decimal degrees (\fIlat1\fR, \fIlon1\fR, \fIlat2\fR, \fIlon2\fR) and
 
45
prints out \fIazi1\fR, \fIazi2\fR, \fIs12\fR for the geodesic line
 
46
between each pair of points on the WGS84 ellipsoid.  (N.B. \fIazi2\fR is
 
47
the forward azimuth at point 2.)
 
48
.nf
 
49
\f(CW
 
50
 
 
51
#include <stdio.h>
 
52
#include <geodesic.h>
 
53
 
 
54
int main() {
 
55
  double a = 6378137, f = 1/298.257223563; /* WGS84 */
 
56
  double lat1, lon1, azi1, lat2, lon2, azi2, s12;
 
57
  struct geod_geodesic g;
 
58
 
 
59
  geod_init(&g, a, f);
 
60
  while (scanf("%lf %lf %lf %lf\en",
 
61
               &lat1, &lon1, &lat2, &lon2) == 4) {
 
62
    geod_inverse(&g, lat1, lon1, lat2, lon2,
 
63
                 &s12, &azi1, &azi2);
 
64
    printf("%.8f %.8f %.3f\en", azi1, azi2, s12);
 
65
  }
 
66
  return 0;
 
67
} \fR
 
68
.br
 
69
.fi
 
70
.SH LIBRARY
 
71
libproj.a \- library of projections and support procedures
 
72
.SH SEE ALSO
 
73
Full online documentation for \fBgeodesic(3)\fR,
 
74
.br
 
75
http://geographiclib.sf.net/1.40/C
 
76
.PP
 
77
.B geod(1)
 
78
.PP
 
79
\fBGeographicLib\fR, http://geographiclib.sf.net
 
80
.PP
 
81
The \fBGeodesicExact\fR class in GeographicLib solves the geodesic
 
82
problems in terms of elliptic integrals; the results are accurate for
 
83
arbitrary \fIf\fR.
 
84
.PP
 
85
C. F. F. Karney, \fIAlgorithms for Geodesics\fR,
 
86
.br
 
87
J. Geodesy \fB87\fR, 43-55 (2013);
 
88
.br
 
89
DOI: http://dx.doi.org/10.1007/s00190-012-0578-z
 
90
.br
 
91
http://geographiclib.sf.net/geod-addenda.html
 
92
.PP
 
93
The \fIonline geodesic bibliography\fR,
 
94
.br
 
95
http://geographiclib.sf.net/geodesic-papers/biblio.html
 
96
.SH HOME PAGE
 
97
http://proj.osgeo.org