]> Pileus Git - grits/blobdiff - src/gis-util.c
Rename GisBBox to GisBounds
[grits] / src / gis-util.c
index 951b45219aff7b5a733e890cf9459320f40c6302..d42cee59d1a33c9c2b06e3950a49258ad0548b8c 100644 (file)
@@ -93,11 +93,11 @@ void gis_point_set_lle(GisPoint *point, gdouble lat, gdouble lon, gdouble elev)
 }
 
 
-/***********
- * GisBBox *
- ***********/
+/*************
+ * GisBounds *
+ *************/
 /**
- * gis_bbox_set_bounds:
+ * gis_bounds_set_bounds:
  * @n: the north edge
  * @s: the south edge
  * @e: the east edge
@@ -105,13 +105,13 @@ void gis_point_set_lle(GisPoint *point, gdouble lat, gdouble lon, gdouble elev)
  *
  * Set the north, south, east, and west edges of the bounding box
  */
-void gis_bbox_set_bounds(GisBBox *bbox,
+void gis_bounds_set_bounds(GisBounds *bounds,
                gdouble n, gdouble s, gdouble e, gdouble w)
 {
-       bbox->n = n;
-       bbox->s = s;
-       bbox->e = e;
-       bbox->w = w;
+       bounds->n = n;
+       bounds->s = s;
+       bounds->e = e;
+       bounds->w = w;
 }
 
 
@@ -191,9 +191,9 @@ void xyz2ll(gdouble x, gdouble y, gdouble z,
  */
 gdouble ll2m(gdouble lon_dist, gdouble lat)
 {
-       gdouble azim = (-lat+90)/180*M_PI;
-       gdouble rad  = sin(azim) * EARTH_R;
-       gdouble circ = 2 * M_PI * rad;
+       gdouble incl = lat2incl(lat);
+       gdouble rad  = sin(incl) * EARTH_R;
+       gdouble circ = 2 * G_PI * rad;
        return lon_dist/360 * circ;
 }