diff options
| -rw-r--r-- | src/apps/gie.cpp | 2 | ||||
| -rw-r--r-- | src/phi2.cpp | 5 | ||||
| -rw-r--r-- | test/gie/builtins.gie | 8 |
3 files changed, 12 insertions, 3 deletions
diff --git a/src/apps/gie.cpp b/src/apps/gie.cpp index 8940afde..2fe854fa 100644 --- a/src/apps/gie.cpp +++ b/src/apps/gie.cpp @@ -1124,7 +1124,7 @@ static const struct errno_vs_err_const lookup[] = { {"pjd_err_invalid_x_or_y" , -15}, {"pjd_err_wrong_format_dms_value" , -16}, {"pjd_err_non_conv_inv_meri_dist" , -17}, - {"pjd_err_non_con_inv_phi2" , -18}, + {"pjd_err_non_conv_sinhpsi2tanphi" , -18}, {"pjd_err_acos_asin_arg_too_large" , -19}, {"pjd_err_tolerance_condition" , -20}, {"pjd_err_conic_lat_equal" , -21}, diff --git a/src/phi2.cpp b/src/phi2.cpp index eb6d5c82..6e810240 100644 --- a/src/phi2.cpp +++ b/src/phi2.cpp @@ -2,6 +2,7 @@ #include <math.h> #include <limits> +#include <algorithm> #include "proj.h" #include "proj_internal.h" @@ -82,8 +83,8 @@ double pj_sinhpsi2tanphi(projCtx ctx, const double taup, const double e) { constexpr int numit = 5; // min iterations = 1, max iterations = 2; mean = 1.954 - constexpr double tol = sqrt(std::numeric_limits<double>::epsilon()) / 10; - constexpr double tmax = 2 / sqrt(std::numeric_limits<double>::epsilon()); + static const double tol = sqrt(std::numeric_limits<double>::epsilon()) / 10; + static const double tmax = 2 / sqrt(std::numeric_limits<double>::epsilon()); double e2m = 1 - e * e, tau = fabs(taup) > 70 ? taup * exp(e * atanh(e)) : taup / e2m, diff --git a/test/gie/builtins.gie b/test/gie/builtins.gie index 402433ca..2432ccb0 100644 --- a/test/gie/builtins.gie +++ b/test/gie/builtins.gie @@ -1434,8 +1434,10 @@ accept -2 1 expect -222650.796797586 110642.229411933 accept -2 -1 expect -222650.796797586 -110642.229411933 +# near pole accept 30 89.9999 expect 5.584698978 10001956.056248082 +# 3900 km from central meridian accept 44.69 35.37 expect 4168136.489446198 4985511.302287407 @@ -1448,8 +1450,10 @@ accept -200 100 expect -0.00179663056816 0.00090436947663 accept -200 -100 expect -0.00179663056816 -0.00090436947663 +# near pole accept 6 1.0001e7 expect 0.35596960759234 89.99135362646302 +# 3900 km from central meridian accept 4168136.489446198 4985511.302287407 expect 44.69 35.37 @@ -5705,8 +5709,10 @@ accept -2 1 expect -222650.796797586 110642.229411933 accept -2 -1 expect -222650.796797586 -110642.229411933 +# near pole accept 30 89.9999 expect 5.584698978 10001956.056248082 +# 3900 km from central meridian accept 44.69 35.37 expect 4168136.489446198 4985511.302287407 @@ -5719,8 +5725,10 @@ accept -200 100 expect -0.00179663056816 0.00090436947663 accept -200 -100 expect -0.00179663056816 -0.00090436947663 +# near pole accept 6 1.0001e7 expect 0.35596960759234 89.99135362646302 +# 3900 km from central meridian accept 4168136.489446198 4985511.302287407 expect 44.69 35.37 |
