summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormvglasow <michael -at- vonglasow.com>2015-11-28 23:18:08 +0100
committermvglasow <michael -at- vonglasow.com>2015-11-28 23:19:42 +0100
commit70755a32842a49a4ae038c6152478f97347b9e9a (patch)
tree7f3640bc2d40473fe1a40f5b0f8afb132d5a5405
parent1f37913f87b2364ce4a0cad6ce1116348a7fdd52 (diff)
downloadnavit-R6409.tar.gz
Refactor:core:Add some documentation in transform.cR6409
Signed-off-by: mvglasow <michael -at- vonglasow.com>
-rw-r--r--navit/transform.c33
1 files changed, 31 insertions, 2 deletions
diff --git a/navit/transform.c b/navit/transform.c
index 76e676906..2f64ced1b 100644
--- a/navit/transform.c
+++ b/navit/transform.c
@@ -325,6 +325,18 @@ transform_from_to(struct coord *cfrom, enum projection from, struct coord *cto,
transform_from_geo(to, &g, cto);
}
+
+/**
+ * @brief Transforms geodetic to Cartesian coordinates.
+ *
+ * This transforms geodetic coordinates (consisting of latitude and longitude) into ECEF Cartesian
+ * coordinates.
+ *
+ * @param geo The WGS84 coordinates to convert
+ * @param a Semi-minor axis of the ellipsoid
+ * @param b Semi-minor axis of the ellipsoid
+ * @param cart Points to a structure that will receive the Cartesian coordinates
+ */
void
transform_geo_to_cart(struct coord_geo *geo, navit_float a, navit_float b, struct coord_geo_cart *cart)
{
@@ -335,6 +347,18 @@ transform_geo_to_cart(struct coord_geo *geo, navit_float a, navit_float b, struc
cart->z=n*(1-ee)*navit_sin(geo->lat);
}
+
+/**
+ * @brief Transforms Cartesian to geodetic coordinates.
+ *
+ * This transforms ECEF Cartesian coordinates into geodetic coordinates, consisting of latitude and
+ * longitude.
+ *
+ * @param cart The Cartesian coordinates
+ * @param a Semi-minor axis of the ellipsoid
+ * @param b Semi-minor axis of the ellipsoid
+ * @param geo Points to a structure that will receive the geodetic coordinates
+ */
void
transform_cart_to_geo(struct coord_geo_cart *cart, navit_float a, navit_float b, struct coord_geo *geo)
{
@@ -355,14 +379,19 @@ transform_cart_to_geo(struct coord_geo_cart *cart, navit_float a, navit_float b,
}
+/**
+ * @brief Converts UTM coords to lat/long.
+ *
+ * Equations from USGS Bulletin 1532.
+ *
+ * @author Chuck Gantz- chuck.gantz@globalstar.com
+ */
void
transform_utm_to_geo(const double UTMEasting, const double UTMNorthing, int ZoneNumber, int NorthernHemisphere, struct coord_geo *geo)
{
-//converts UTM coords to lat/long. Equations from USGS Bulletin 1532
//East Longitudes are positive, West longitudes are negative.
//North latitudes are positive, South latitudes are negative
//Lat and Long are in decimal degrees.
- //Written by Chuck Gantz- chuck.gantz@globalstar.com
double Lat, Long;
double k0 = 0.99960000000000004;