From 29a59cadb9d1371479477af517f3431784e880f9 Mon Sep 17 00:00:00 2001 From: Kristian Evers Date: Thu, 14 Feb 2019 12:00:45 +0100 Subject: Reverse direction of deformation operations/transformations/deformation Changed the direction of dt-calculation to follow the same convention as helmert. Changed from dt = t_c - t_obs to dt = t_obs - t_c, which effectively reverses the direction of the operation. Existing projstrings using deformation can simply reverse the direction of the operation to achieve the same results as before this commit. --- src/transformations/deformation.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'src/transformations') diff --git a/src/transformations/deformation.cpp b/src/transformations/deformation.cpp index 9221d39e..14f34e4e 100644 --- a/src/transformations/deformation.cpp +++ b/src/transformations/deformation.cpp @@ -172,7 +172,7 @@ static PJ_XYZ forward_3d(PJ_LPZ lpz, PJ *P) { out = in; if (Q->t_obs != HUGE_VAL) { - dt = Q->t_epoch - Q->t_obs; + dt = Q->t_obs - Q->t_epoch; } else { out = proj_coord_error(); /* in the 3D case +t_obs must be specified */ proj_log_debug(P, "deformation: +t_obs must be specified"); @@ -196,9 +196,9 @@ static PJ_COORD forward_4d(PJ_COORD in, PJ *P) { PJ_COORD out = in; if (Q->t_obs != HUGE_VAL) { - dt = Q->t_epoch - Q->t_obs; + dt = Q->t_obs - Q->t_epoch; } else { - dt = Q->t_epoch - in.xyzt.t; + dt = in.xyzt.t - Q->t_epoch ; } shift = get_grid_shift(P, in.xyz); @@ -219,7 +219,7 @@ static PJ_LPZ reverse_3d(PJ_XYZ in, PJ *P) { out.xyz = in; if (Q->t_obs != HUGE_VAL) { - dt = Q->t_epoch - Q->t_obs; + dt = Q->t_obs - Q->t_epoch; } else { out = proj_coord_error(); /* in the 3D case +t_obs must be specified */ proj_log_debug(P, "deformation: +t_obs must be specified"); @@ -238,9 +238,9 @@ static PJ_COORD reverse_4d(PJ_COORD in, PJ *P) { if (Q->t_obs != HUGE_VAL) { - dt = Q->t_epoch - Q->t_obs; + dt = Q->t_obs - Q->t_epoch; } else { - dt = Q->t_epoch - in.xyzt.t; + dt = in.xyzt.t - Q->t_epoch; } out.xyz = reverse_shift(P, in.xyz, dt); -- cgit v1.2.3