MCPcopy Create free account
hub / github.com/Kitware/VTK / proj_roundtrip

Function proj_roundtrip

ThirdParty/libproj/vtklibproj/src/4D_api.cpp:171–202  ·  view source on GitHub ↗

Measure numerical deviation after n roundtrips fwd-inv (or inv-fwd) */

Source from the content-addressed store, hash-verified

169
170/* Measure numerical deviation after n roundtrips fwd-inv (or inv-fwd) */
171double proj_roundtrip (PJ *P, PJ_DIRECTION direction, int n, PJ_COORD *coord) {
172 int i;
173 PJ_COORD t, org;
174
175 if (nullptr==P)
176 return HUGE_VAL;
177
178 if (n < 1) {
179 proj_log_error(P, _("n should be >= 1"));
180 proj_errno_set (P, PROJ_ERR_OTHER_API_MISUSE);
181 return HUGE_VAL;
182 }
183
184 /* in the first half-step, we generate the output value */
185 org = *coord;
186 *coord = proj_trans (P, direction, org);
187 t = *coord;
188
189 /* now we take n-1 full steps in inverse direction: We are */
190 /* out of phase due to the half step already taken */
191 for (i = 0; i < n - 1; i++)
192 t = proj_trans (P, direction, proj_trans (P, opposite_direction(direction), t) );
193
194 /* finally, we take the last half-step */
195 t = proj_trans (P, opposite_direction(direction), t);
196
197 /* checking for angular *input* since we do a roundtrip, and end where we begin */
198 if (proj_angular_input (P, direction))
199 return proj_lpz_dist (P, org, t);
200
201 return proj_xyz_dist (org, t);
202}
203
204/**************************************************************************************/
205int pj_get_suggested_operation(PJ_CONTEXT*,

Callers

nothing calls this directly

Calls 7

proj_log_errorFunction · 0.85
proj_errno_setFunction · 0.85
proj_transFunction · 0.85
opposite_directionFunction · 0.85
proj_angular_inputFunction · 0.85
proj_lpz_distFunction · 0.85
proj_xyz_distFunction · 0.85

Tested by

no test coverage detected