From 8731336c9101b1948b401e0b0d8149598d56fa90 Mon Sep 17 00:00:00 2001 From: Kristian Evers Date: Wed, 12 Jul 2017 10:42:44 +0200 Subject: Implemented proj_obs() --- src/pj_obs_api.c | 20 +++++++++++++++++++- src/proj.h | 4 ++-- 2 files changed, 21 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/pj_obs_api.c b/src/pj_obs_api.c index e52d9c1c..1b353b46 100644 --- a/src/pj_obs_api.c +++ b/src/pj_obs_api.c @@ -42,6 +42,7 @@ #include +/* Initialize PJ_COORD struct */ PJ_COORD proj_coord (double x, double y, double z, double t) { PJ_COORD res; res.v[0] = x; @@ -51,6 +52,24 @@ PJ_COORD proj_coord (double x, double y, double z, double t) { return res; } +/* Initialize PJ_OBS struct */ +PJ_OBS proj_obs (double x, double y, double z, double t, double o, double p, double k, int id, unsigned int flags) { + PJ_OBS res; + res.coo.v[0] = x; + res.coo.v[1] = y; + res.coo.v[2] = z; + res.coo.v[3] = t; + res.anc.v[0] = o; + res.anc.v[1] = p; + res.anc.v[2] = k; + res.id = id; + res.flags = flags; + + return res; +} + + + /* Geodesic distance between two points with angular 2D coordinates */ double proj_lp_dist (PJ *P, LP a, LP b) { double s12, azi1, azi2; @@ -476,4 +495,3 @@ double proj_todeg (double angle_in_radians) { return PJ_TODEG (angle_in_radians) int proj_transform_obs (PJ *P, enum proj_direction direction, size_t n, PJ_OBS *obs); int proj_transform_coord (PJ *P, enum proj_direction direction, size_t n, PJ_COORD *coord); -PJ_OBS proj_obs (double x, double y, double z, double t, double o, double p, double k, int id, unsigned int flags); diff --git a/src/proj.h b/src/proj.h index b5a659d4..d15a798f 100644 --- a/src/proj.h +++ b/src/proj.h @@ -312,9 +312,9 @@ size_t proj_transform ( ); -/* not a constructor, but an initializer */ +/* Initializers */ PJ_COORD proj_coord (double x, double y, double z, double t); - +PJ_OBS proj_obs (double x, double y, double z, double t, double o, double p, double k, int id, unsigned int flags); /* Measure internal consistency - in forward or inverse direction */ double proj_roundtrip (PJ *P, enum proj_direction direction, int n, PJ_OBS obs); -- cgit v1.2.3