#include <PalmOS.h>#include <PalmCompatibility.h>#include "MathLib.h"#include "geo.h"#include "common.h"#include "utm.h"#include "fp.h"Include dependency graph for geo.c:

Go to the source code of this file.
Defines | |
| #define | SQR(x) ((x) * (x)) |
| square, i.e. | |
| #define | EPS 0.00000000000000000000005 |
| epsilon, i.e. | |
Functions | |
| double | calcR (double lat) |
| Calculate Earth radius at given latitude according to GRS80/WGS84 Ellipsoid. | |
| void | init_radius (void) |
| Initialize look-up table with Earth's radii (in meters) at given latitudes. | |
| void | calcxy (Int32 *posx, Int32 *posy, double lon, double lat, double zero_lon, double zero_lat, UInt32 scale) |
| Calculate screen position from current position and map parameters. | |
| char | Lat_To_UTM_Belt (double lat) |
| Calculate UTM Belt from latitude. | |
| double | semi2deg (Int32 semi) |
| Convert semicircles to degrees. | |
| Int32 | deg2semi (double deg) |
| Convert degrees to semicircles. | |
| double | rad2deg (double rad) |
| Convert radians to degrees. | |
| double | deg2rad (double deg) |
| Convert degrees to radians. | |
| void | deg_to_d_str (double lat, double lon, char *lat_d_str, char *lon_d_str) |
| Convert degrees to degrees string for latitude and longitude. | |
| void | deg_to_dm_str (double lat, double lon, char *lat_dm_str, char *lon_dm_str) |
| Convert degrees to degrees and minutes string for latitude and longitude. | |
| void | deg_to_dms_str (double lat, double lon, char *lat_dms_str, char *lon_dms_str) |
| Convert degrees to degrees, minutes and seconds string for latitude and longitude. | |
| void | deg_to_geodb_str (double lat, double lon, char *lat_str, char *lon_str) |
| Convert degrees to degrees and minutes string for latitude and longitude as required by GeoDB. | |
| Boolean | deg_to_str (double lat, double lon, UInt8 pos_unit, char *lat_strP, char *lon_strP, char *field_strP, double *eastP, double *northP) |
| Convert position to string according to selected position unit. | |
| double | gc_dist_sphere (double lat1, double lon1, double lat2, double lon2) |
| Calculate Great Circle distance on spheroid of two points specified by latitude and longitude in degrees. | |
| double | gc_course_sphere (double lat1, double lon1, double lat2, double lon2) |
| Calculate initial Great Circle course between two points on spheroid specified by latitude and longitude in degrees. | |
Variables | |
| double | Ra [101] |
| Earth's radius in meters at given latitude (in integer degrees). | |
|
|
epsilon, i.e. a really small number greater than zero Definition at line 99 of file geo.c. Referenced by gc_course_sphere(). |
|
|
square, i.e. x^2 Definition at line 96 of file geo.c. Referenced by gc_dist_sphere(). |
|
|
Calculate Earth radius at given latitude according to GRS80/WGS84 Ellipsoid. see: The Universal Grids: Universal Transverse Mercator (UTM) and Universal Polar Stereographic (UPS) Defense Mapping Agency Technical Manual 8358.2 http://www.nima.mil/GandG/pubs.html (Section 2-2.1 Ellipsoid Parameters)
Definition at line 127 of file geo.c. References a, M_PI, pow(), r, SEMIMAJOR_AXIS, and sin(). Referenced by ApproachFormHandleEvent(), CheckApproach(), init_radius(), NavigationFormHandleEvent(), and TrackIntervalCheck(). |
|
||||||||||||||||||||||||||||||||
|
Calculate screen position from current position and map parameters.
TBD: Check geodetic background of formulae! Definition at line 200 of file geo.c. References cos(), fabs(), M_PI, PIXELFACT, and Ra. Referenced by MapFormHandleEvent(), and search_map(). |
|
|
Convert degrees to radians.
Definition at line 305 of file geo.c. References M_PI. Referenced by deg_to_str(), gc_course_sphere(), gc_dist_sphere(), and NavigationFormHandleEvent(). |
|
|
Convert degrees to semicircles. semicircles = degrees * (2^31 / 180)
Definition at line 277 of file geo.c. Referenced by TrackWriteLog(). |
|
||||||||||||||||||||
|
Convert degrees to degrees string for latitude and longitude.
Definition at line 324 of file geo.c. References StrCopy, and StrLen. Referenced by deg_to_str(). |
|
||||||||||||||||||||
|
Convert degrees to degrees and minutes string for latitude and longitude.
Definition at line 385 of file geo.c. References StrCopy, and StrLen. Referenced by deg_to_str(). |
|
||||||||||||||||||||
|
Convert degrees to degrees, minutes and seconds string for latitude and longitude.
Definition at line 459 of file geo.c. References StrCopy, and StrLen. Referenced by deg_to_str(). |
|
||||||||||||||||||||
|
Convert degrees to degrees and minutes string for latitude and longitude as required by GeoDB.
Definition at line 547 of file geo.c. Referenced by Position2Geodb(). |
|
||||||||||||||||||||||||||||||||||||
|
Convert position to string according to selected position unit.
Definition at line 634 of file geo.c. References Convert_Geodetic_To_UTM(), deg2rad(), deg_to_d_str(), deg_to_dm_str(), deg_to_dms_str(), format_number(), Lat_To_UTM_Belt(), POS_D, POS_DM, POS_DMS, POS_UTM, StrCopy, and UTM_NO_ERROR. Referenced by Position2Clipboard(). |
|
||||||||||||||||||||
|
Calculate initial Great Circle course between two points on spheroid specified by latitude and longitude in degrees. As opposed to the source (see below), the following convention is followed:
Source: Aviation Formulary V1.41 By Ed Williams http://williams.best.vwh.net/avform.htm
Definition at line 753 of file geo.c. References atan2(), cos(), deg2rad(), EPS, fmod(), M_PI, and sin(). Referenced by NavigationFormHandleEvent(). |
|
||||||||||||||||||||
|
Calculate Great Circle distance on spheroid of two points specified by latitude and longitude in degrees. Source: Aviation Formulary V1.41 By Ed Williams http://williams.best.vwh.net/avform.htm
Definition at line 714 of file geo.c. References asin(), cos(), deg2rad(), sin(), SQR, and sqrt(). Referenced by ApproachFormHandleEvent(), CheckApproach(), NavigationFormHandleEvent(), TrackIntervalCheck(), and UpdateActWpt(). |
|
|
Initialize look-up table with Earth's radii (in meters) at given latitudes. To save memory and to reduce time required for initialization, the symmetry is exploitet. ( sin(90°+x) = sin(90°-x) ) |
|
|
Calculate UTM Belt from latitude.
Definition at line 231 of file geo.c. References floor(). Referenced by deg_to_str(). |
|
|
Convert radians to degrees.
Definition at line 291 of file geo.c. References M_PI. Referenced by NavigationFormHandleEvent(), and WayptEditFormHandleEvent(). |
|
|
Convert semicircles to degrees. degrees = semicircles * (180 / 2^31)
Definition at line 263 of file geo.c. Referenced by ApproachFormHandleEvent(), CheckApproach(), UpdateActWpt(), and WayptEditFormHandleEvent(). |
|
|
Earth's radius in meters at given latitude (in integer degrees).
Definition at line 102 of file geo.c. Referenced by calcxy(), and init_radius(). |