Calculate distance between to geolocations.
More...
#include "jurassic.h"
Go to the source code of this file.
|
int | main (int argc, char *argv[]) |
|
Calculate distance between to geolocations.
Definition in file distance.c.
◆ main()
int main |
( |
int |
argc, |
|
|
char * |
argv[] |
|
) |
| |
Definition at line 28 of file distance.c.
30 {
31
32 double x0[3], x1[3];
33
34
35 if (argc < 5)
36 ERRMSG("Give parameters: <lon0> <lat0> <lon1> <lat1>");
37
38
39 const double lon0 = atof(argv[1]);
40 const double lat0 = atof(argv[2]);
41 const double lon1 = atof(argv[3]);
42 const double lat1 = atof(argv[4]);
43
44
45 geo2cart(0, lon0, lat0, x0);
46 geo2cart(0, lon1, lat1, x1);
47 printf("%g\n", DIST(x0, x1));
48
49 return EXIT_SUCCESS;
50}