]> git.street.me.uk Git - andy/viking.git/blame_incremental - test/degrees_converter.c
Add capability to define the URL format for web links.
[andy/viking.git] / test / degrees_converter.c
... / ...
CommitLineData
1#include <stdio.h>
2#include <stdlib.h>
3#include "degrees_converters.h"
4
5int main(int argc, char *argv[]) {
6 int i;
7 gdouble value;
8 gchar *latDDD, *lonDDD;
9 gchar *latDMM, *lonDMM;
10 gchar *latDMS, *lonDMS;
11 for (i=1 ; i < argc ; i++) {
12 value = convert_dms_to_dec(argv[i]);
13 latDDD = convert_lat_dec_to_ddd(value);
14 lonDDD = convert_lon_dec_to_ddd(value);
15 latDMM = convert_lat_dec_to_dmm(value);
16 lonDMM = convert_lon_dec_to_dmm(value);
17 latDMS = convert_lat_dec_to_dms(value);
18 lonDMS = convert_lon_dec_to_dms(value);
19 printf("'%s' -> %f %s %s %s %s %s %s\n", argv[i], value,
20 latDDD, lonDDD, latDMM, lonDMM, latDMS, lonDMS);
21 free(latDMS); free(lonDMS);
22 free(latDMM); free(lonDMM);
23 free(latDDD); free(lonDDD);
24 }
25 return 0;
26}