00001 #include "math.h" 00002 #include "gpsmath.h" 00003 00004 struct GPS_DATA GPS_Data; 00005 struct GPS_DATA gps_data_temp; 00006 00007 unsigned int gpsDataOkTrigger=0; 00008 00009 void xy2latlon(double lat0, double lon0, double X, double Y, double *lat, double *lon) //X: East, Y: North in m; lat0,lon0: Reference coordinates; lat,lon: current GPS measurement 00010 { 00011 *lat=lat0+Y/MEAN_EARTH_DIAMETER*360./M_PI; 00012 *lon=lon0+X/MEAN_EARTH_DIAMETER*360./M_PI/cos(lat0*UMR); 00013 } 00014 00015