00001 /***************************************************************************** 00002 * 00003 * $RCSfile: geo_8h-source.html,v $ 00004 * 00005 * GPS4Palm Geodesic/Geometric Utility Functions 00006 * 00007 * History: 00008 * 2003-07-06: first version 00009 * 00010 * This program is Copyright (C) 07/2003 Matthias Prinke 00011 * <matthias.prinke@surfeu.de> and covered by GNU's GPL. 00012 * In particular, this program is free software and comes WITHOUT 00013 * ANY WARRANTY. 00014 * 00015 * $Author: mp $ 00016 * 00017 * $Date: 2007-10-08 20:40:33 $ 00018 * 00019 * $Revision: 1.7.2.1 $ 00020 * 00021 * $Log: geo_8h-source.html,v $ 00021 * Revision 1.7.2.1 2007-10-08 20:40:33 mp 00021 * updated for gps4palm V0.9.5 beta 00021 * 00022 * Revision 1.11 2005-04-02 07:22:16 mp 00023 * added deg_to_geodb_str() 00024 * 00025 * Revision 1.10 2005/03/25 13:31:35 mp 00026 * added deg_to_str() 00027 * 00028 * Revision 1.9 2004/11/26 19:56:45 mp 00029 * added deg_to_d_str() 00030 * 00031 * Revision 1.8 2004/03/11 18:51:24 mp 00032 * modified gc_course_sphere() 00033 * 00034 * Revision 1.7 2004/03/10 21:57:36 mp 00035 * added calcR() 00036 * 00037 * Revision 1.6 2004/03/10 17:09:13 mp 00038 * Added rad2deg(), deg2rad(), gc_dist_sphere(), and gc_course_sphere(). 00039 * 00040 * Revision 1.5 2004/02/28 13:20:51 mp 00041 * added semi2deg(), deg2semi(), deg_to_dm_str(), and deg_to_dms_str() 00042 * 00043 * Revision 1.4 2004/01/18 11:43:07 mp 00044 * added defines, added Lat_To_UTM_Belt() 00045 * 00046 * Revision 1.3 2004/01/17 15:46:16 mp 00047 * moved to code section geo 00048 * 00049 * Revision 1.2 2003/10/20 19:13:10 mp 00050 * replaced parameter zoom by scale 00051 * 00052 * Revision 1.1.1.1 2003/07/14 18:59:29 mp 00053 * Imported GPS4Palm to CVS revision control. 00054 * 00055 * 00056 ****************************************************************************/ 00057 #ifndef GEO_H 00058 #define GEO_H 00059 00060 #define SEMIMAJOR_AXIS 6378137 // m, GRS80/WGS84 Ellipsoid 00061 #define FLATTENING (1 / 298.257223563) // GRS80/WGS84 Ellipsoid 00062 #define M_PI 3.14159265358979323e0 // pi 00063 #define PIXELFACT 2834.65 // pixel/m 00064 00065 #define GEO_SECTION __attribute__ ((section ("geo"))) 00066 00067 00068 void init_radius(void) GEO_SECTION; 00069 double calcR(double lat) GEO_SECTION; 00070 void calcxy(Int32 *posx, Int32 *posy, double lon, double lat, 00071 double zero_lon, double zero_lat, UInt32 scale) GEO_SECTION; 00072 char Lat_To_UTM_Belt(double lat) GEO_SECTION; 00073 double semi2deg(Int32 semi) GEO_SECTION; 00074 Int32 deg2semi(double deg) GEO_SECTION; 00075 double rad2deg(double rad) GEO_SECTION; 00076 double deg2rad(double deg) GEO_SECTION; 00077 void deg_to_d_str(double lat, double lon, 00078 char *lat_d_str, char *lon_d_str) GEO_SECTION; 00079 void deg_to_dm_str(double lat, double lon, 00080 char *lat_dm_str, char *lon_dm_str) GEO_SECTION; 00081 void deg_to_dms_str(double lat, double lon, 00082 char *lat_dms_str, char *lon_dms_str) GEO_SECTION; 00083 void deg_to_geodb_str(double lat, double lon, 00084 char *lat_str, char *lon_str) GEO_SECTION; 00085 Boolean deg_to_str(double lat, double lon, UInt8 pos_unit, 00086 char *lat_strP, char *lon_strP, char *field_strP, 00087 double *eastP, double *northP) GEO_SECTION; 00088 double gc_dist_sphere(double lat1, double lon1, 00089 double lat2, double lon2) GEO_SECTION; 00090 double gc_course_sphere(double lat1, double lon1, 00091 double lat2, double lon2) GEO_SECTION; 00092 #endif