00001 #include <grass/gis.h> 00002 /* For lat-lon, 00003 * this routine adjusts the values of the longitudes so that 00004 * the difference between them is less than 180. 00005 * It does NOT change their true position. 00006 * For other databases 00007 * this routine does nothing 00008 */ 00009 00023 int G_shortest_way (double *east1,double *east2) 00024 { 00025 if (G_projection() == PROJECTION_LL) 00026 { 00027 if (*east1 > *east2) 00028 while ((*east1-*east2) > 180) 00029 *east2 += 360; 00030 else if (*east2 > *east1) 00031 while ((*east2-*east1) > 180) 00032 *east1 += 360; 00033 } 00034 00035 return 0; 00036 }