aboutsummaryrefslogtreecommitdiffstats
path: root/libtellurian_coarse_distance.3
blob: a490ba76c585cc680b0d026d52b3c2e0e5dc3756 (plain) (blame)
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
.TH LIBTELLURIAN_COARSE_DISTANCE 3 libtellurian
.SH NAME
libtellurian_coarse_distance \- Calculate distance between two locations

.SH SYNPOSIS
.nf
#include <libtellurian.h>

double libtellurian_coarse_distance(double \fIlatitude1\fP, double \fIlongitude1\fP,
                                    double \fIlatitude2\fP, double \fIlongitude2\fP);

double libtellurian_coarse_distance_radians(double \fIlatitude1\fP, double \fIlongitude1\fP,
                                            double \fIlatitude2\fP, double \fIlongitude2\fP);

extern const double libtellurian_coarse_distance_radius;
.fi
.PP
Link with
.I -ltellurian
.IR -lm .

.SH DESCRIPTION
The
.BR libtellurian_coarse_distance ()
function calculates a coarse approximate
spherical distance between two locations,
.RI ( latitude1 ", " longitude1 )
and
.RI ( latitude2 ", " longitude2 ),
on the Earth's surface modelling the Earth
as a perfect sphere.
.PP
The coordinates shall be specified according
to GPS and in degrees.
.PP
The
.BR libtellurian_coarse_distance_radians ()
function is identical to the
.BR libtellurian_coarse_distance ()
function except that
.IR latitude1 ,
.IR longitude1 ,
.IR latitude2 ,
and
.I longitude2
shall be specified in radians.
.PP
The constant variable
.B libtellurian_coarse_distance_radius
is set to the radius used in the model of the
Earth that these functions use. If you want a
better local approximation of distances, you
can multiple the return values by the local radius
(you can use the
.BR libtellurian_sea_level (3)
function) divided by
.BR libtellurian_coarse_distance_radius .

.SH RETURN VALUE
The
.BR libtellurian_coarse_distance ()
and
.BR libtellurian_coarse_distance_radians ()
functions return the distance, along the Earth's
surface, between the two points measured in
meters.

.SH ERRORS
None.

.SH SEE ALSO
.BR libtellurian (7),
.BR libtellurian_distance (3)