diff options
author | KatolaZ <katolaz@freaknet.org> | 2022-10-06 11:38:17 +0100 |
---|---|---|
committer | KatolaZ <katolaz@freaknet.org> | 2022-10-06 11:38:17 +0100 |
commit | 304656477bb4f6c68b5a24a5cd8bbb49d1403cdf (patch) | |
tree | ea62c5c4bd566bdc69012c7fa99b810ccf3d62c8 /gridcal.c | |
parent | 2e07eff6639fc134305a3f460402182b696f4c04 (diff) |
add more comments in README.md
Diffstat (limited to 'gridcal.c')
-rw-r--r-- | gridcal.c | 14 |
1 files changed, 11 insertions, 3 deletions
@@ -15,8 +15,16 @@ #include <ctype.h> #define MIN(a,b) ((a)>(b)?(b):(a)) +#define R 6371 -double R = 6371; +#ifndef M_PI +#define M_PI 3.14159265358979323846 /* pi */ +#endif + + +#ifndef M_PI_2 +#define M_PI_2 1.57079632679489661923 /* pi/2 */ +#endif typedef struct { double lat; @@ -26,7 +34,7 @@ typedef struct { void usage(char *argv0){ - printf("Usage: %s <grid1> <grid2> [<pwr>]", argv0); + printf("Usage: %s <loc1> [<loc2> [<pwr>]]", argv0); exit(1); } @@ -117,7 +125,7 @@ int main(int argc, char *argv[]){ loc1[n1] = '\0'; check_input(loc1); grid_to_latlon(loc1, &c1); - printf("%s %g %g\n", loc1, c1.lat, c1.lon); + printf("%s %g %g %g %g\n", loc1, c1.lat*180/M_PI, c1.lon*180/M_PI, c1.lat, c1.lon); exit(0); } |