#include "gis-util.h"
+/************
+ * GisPoint *
+ ************/
+/**
+ * gis_point_set_lle:
+ * @point: the point to modify
+ * @lat: the new latitude
+ * @lon: the new longitude
+ * @elev: the new elevation
+ *
+ * Set the latitude, longitude, and elevation for a point.
+ */
+void gis_point_set_lle(GisPoint *point, gdouble lat, gdouble lon, gdouble elev)
+{
+ point->lat = lat;
+ point->lon = lon;
+ point->elev = elev;
+}
+
+
+/*************
+ * GisBounds *
+ *************/
+/**
+ * gis_bounds_set_bounds:
+ * @n: the north edge
+ * @s: the south edge
+ * @e: the east edge
+ * @w: the west edge
+ *
+ * Set the north, south, east, and west edges of the bounding box
+ */
+void gis_bounds_set_bounds(GisBounds *bounds,
+ gdouble n, gdouble s, gdouble e, gdouble w)
+{
+ bounds->n = n;
+ bounds->s = s;
+ bounds->e = e;
+ bounds->w = w;
+}
+
+
/******************
* Global helpers *
******************/
*/
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;
}