-
Notifications
You must be signed in to change notification settings - Fork 36
/
geog_lib.3
101 lines (91 loc) · 5.19 KB
/
geog_lib.3
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
.\"
.\" Copyright (c) 2011, Gordon D. Carrie. All rights reserved.
.\"
.\" Redistribution and use in source and binary forms, with or without
.\" modification, are permitted provided that the following conditions
.\" are met:
.\"
.\" * Redistributions of source code must retain the above copyright
.\" notice, this list of conditions and the following disclaimer.
.\" * Redistributions in binary form must reproduce the above copyright
.\" notice, this list of conditions and the following disclaimer in the
.\" documentation and/or other materials provided with the distribution.
.\"
.\" THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
.\" "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
.\" LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
.\" A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
.\" HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
.\" SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
.\" TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
.\" PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
.\" LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
.\" NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
.\" SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
.\"
.\" Please address questions and feedback to dev0@trekix.net
.\"
.\" $Revision: 1.23 $ $Date: 2013/05/23 21:52:15 $
.\"
.TH geog_lib 3 "geography functions"
.SH NAME
GeogLonR, GeogLatN, GeogDist \- geography functions
.SH SYNOPSIS
.nf
\fB#include "geog_lib.h"\fP
\fBvoid GeogDMS(double\fP \fIddeg\fP, \fBdouble\fP *\fIdeg\fP, \fBdouble\fP *\fImin\fP, \fBdouble\fP *\fIsec\fP, \fBchar\fP *\fIfmt);\fP
\fBdouble GeogREarth(const double\fP *\fIr\fB);\fP
\fBdouble GeogLonR(const double\fP \fIl\fP, \fBconst double\fP \fIr\fP\fB);\fP
\fBdouble GeogLonDiff(const double\fP \fIl\fP, \fBconst double\fP \fIr\fP\fB);\fP
\fBdouble GeogLatN(const double\fP \fIl\fP\fB);\fP
\fBdouble GeogDist(const double\fP \fIlon1\fP, \fBconst double\fP \fIlat1\fP,
\fBconst double\fP \fIlon2\fP, \fBconst double\fP \fIlat2\fP\fB);\fP
\fBdouble GeogAz(const double\fP \fIlon1\fP, \fBconst double\fP \fIlat1\fP,
\fBconst double\fP \fIlon2\fP, \fBconst double\fP \fIlat2\fP\fB);\fP
\fBvoid GeogStep(const double\fP \fIlon0\fP, \fBconst double\fP \fIlat0\fP,
\fBconst double\fP \fIdirn\fP, \fBconst double\fP \fIdist\fP, \fBdouble\fP *lon1\fP, \fBdouble\fP *\fIlat1\fP\fB);\fP
\fBdouble\fP \fBGeogBeamHt\fP(\fBdouble\fP \fId\fP, \fBdouble\fP \fItilt\fP, \fBdouble\fP \fIa0\fP);
\fBint\fP \fBGeogContainPt\fP(\fBconst struct GeogPt\fP \fIpt, \fBconst struct GeogPt\fP *\fIpts, \fBconst size_t\fP \fIn_pts\fP);
.fi
.SH DESCRIPTION
Unless otherwise stated, longitudes, latitudes, and other angles are expressed
in radians.
\fBGeogDMS\fP puts degrees, minutes, and seconds corresponding to \fIddeg\fP into
\fIdeg\fP, \fImin\fP, \fIsec\fP respectively. If \fIfmt\fP is not \fBNULL\fP, it
must contain a format specifier to print double precision output \fBsnprintf\fP.
If *\fImin\fP or *\fIsec\fP produce \fB60\fP or \fB-60\fP if printed with
\fIfmt\fP, the return values are adjusted. If \fIfmt\fP is \fBNULL\fP, results
use double precision.
\fBGeogREarth\fP gets or sets radius of the Earth. If \fIr\fP is \fBNULL\fP,
it returns the value in environment variable \fBGEOG_REARTH\fP, if set,
or the built in default, which is initialized to 6366707.019.
The built in default corresponds to an International Standard Nautical Mile
(1 minute of latitude) of 1852 meters. If \fIr\fP is not \fBNULL\fP, the stored
value is replaced with *\fIr\fP, which is returned. All future calls will return
the value from the latest non-\fBNULL\fP call.
\fBGeogLonR\fP returns a longitude equivalent to \fIl\fP in a longitude domain
centered about \fIr\fP. The return value is \fIl\fP\ +\ i\ *\ \fB2 * pi\fP for
some integer i, and is in the interval
[\fIr\fP\ -\ \fBpi / 2\fP,\ \fIr\fP\ +\ \fBpi / 2\fP).
\fBGeogLonDiff\fP returns \fIl\fP\ -\ \fIr\fP in
[\fIr\fP\ -\ \fBpi / 2\fP,\ \fIr\fP\ +\ \fBpi / 2\fP).
\fBGeogLatN\fP returns the latitude reached by going \fIl\fP radians north of
the Equator.
\fBGeogDist\fP returns the great circle distance in radians between points
(\fIlon1\fP,\ \fIlat1\fP) and (\fIlon2\fP,\ \fIlat2\fP).
\fBGeogAz\fP returns the great circle azimuth (direction) in radians clockwise
from North from point (\fIlon1\fP,\ \fIlat1\fP) to point (\fIlon2\fP,\ \fIlat2\fP).
\fBGeogStep\fP computes the longitude and latitude of the point in direction
\fIdirn\fP and distance \fIdist\fP along a great circle from point
(\fIlon0\fP,\ \fIlat0\fP). It places the longitude and latitude of the destination
point at addresses \fIlon1\fP and \fIlat1\fP respectively.
\fBGeogBeamHt\fP returns height attained after traveling distance \fId\fP
along a beam at angle \fItilt\fP above horizontal, assuming Earth radius \fIa0\fP.
\fId\fP and \fIa0\fP must use the same unit, which will also be the unit of the
return value.
\fBGeogContainPt\fP returns true if \fIpt\fP is contained in the polygon defined
by \fIn_pts\fP points starting at \fIpts.
.SH SEE ALSO
\fBgeog\fP (1)
.SH AUTHOR
Gordon Carrie (dev0@trekix.net)