GRASS Programmer's Manual  6.5.svn(2014)-r66266
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
short_way.c
Go to the documentation of this file.
1 
17 #include <grass/gis.h>
18 
19 
33 int G_shortest_way(double *east1, double *east2)
34 {
35  if (G_projection() == PROJECTION_LL) {
36  if (*east1 > *east2)
37  while ((*east1 - *east2) > 180)
38  *east2 += 360;
39  else if (*east2 > *east1)
40  while ((*east2 - *east1) > 180)
41  *east1 += 360;
42  }
43 
44  return 0;
45 }
int G_shortest_way(double *east1, double *east2)
Shortest way between two eastings.
Definition: short_way.c:33
int G_projection(void)
query cartographic projection
Definition: proj1.c:33