X-Git-Url: http://pileus.org/git/?p=grits;a=blobdiff_plain;f=src%2Fgis-util.c;h=d42cee59d1a33c9c2b06e3950a49258ad0548b8c;hp=951b45219aff7b5a733e890cf9459320f40c6302;hb=e4de9d051f0f61a2f0eaa97e631bc7b891dc2eaf;hpb=5350256efff1c97426e0db60e404bfd8a6cb08be diff --git a/src/gis-util.c b/src/gis-util.c index 951b452..d42cee5 100644 --- a/src/gis-util.c +++ b/src/gis-util.c @@ -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; }