]> Pileus Git - grits/blobdiff - src/grits-util.h
Start work on lle2ned for finding coords of cursor
[grits] / src / grits-util.h
index ccfff162e594544fab017eb2d3b36f50f94f3a58..0e5b00e8d0926ced9cb0c59c9a151081582d1196 100644 (file)
@@ -159,6 +159,9 @@ struct _GritsPoint {
 void grits_point_set_lle(GritsPoint *point,
                gdouble lat, gdouble lon, gdouble elev);
 
+/* GritsPoints */
+typedef gdouble (*GritsPoints)[3];
+
 /* GritsBounds */
 typedef struct _GritsBounds GritsBounds;
 struct _GritsBounds {
@@ -177,7 +180,7 @@ void grits_bounds_set_bounds(GritsBounds *bounds,
  *
  * Used by GritsOpenGL to set up the drawing window
  */
-#define FOV_DIST   2000.0
+#define FOV_DIST   (1039.23)
 
 /**
  * MPPX:
@@ -187,7 +190,7 @@ void grits_bounds_set_bounds(GritsBounds *bounds,
  *
  * Returns: the resolution in meters per pixel
  */
-#define MPPX(dist) (4*dist/FOV_DIST)
+#define MPPX(dist) (dist/FOV_DIST)
 
 void lle2xyz(gdouble lat, gdouble lon, gdouble elev,
                gdouble *x, gdouble *y, gdouble *z);
@@ -198,6 +201,10 @@ void xyz2lle(gdouble x, gdouble y, gdouble z,
 void xyz2ll(gdouble x, gdouble y, gdouble z,
                gdouble *lat, gdouble *lon);
 
+void lle2ned(gdouble lat, gdouble lon, gdouble elev,
+               gdouble rlat, gdouble rlon, gdouble relev,
+               gdouble *x, gdouble *y, gdouble *z);
+
 gdouble ll2m(gdouble lon_dist, gdouble lat);
 
 gdouble distd(gdouble *a, gdouble *b);
@@ -212,4 +219,10 @@ void normd(gdouble *a);
 
 gdouble lon_avg(gdouble a, gdouble b);
 
+GritsPoints *parse_points(const gchar *string,
+               const gchar *group_sep, const gchar *point_sep, const gchar *coord_sep,
+               GritsBounds *bounds, GritsPoint *center);
+
+void free_points(GritsPoints *points);
+
 #endif