diff options
| author | Charles Karney <charles.karney@sri.com> | 2020-10-27 10:02:27 -0400 |
|---|---|---|
| committer | Charles Karney <charles.karney@sri.com> | 2020-10-27 10:02:27 -0400 |
| commit | 94e36270ca393bd7b107bf690f09fd8ec1cd046b (patch) | |
| tree | dd153675742ead1db539f3b7d155b6bb95ba4d7c | |
| parent | 6bd7c777f8e789f8ea34a6aa68104ab44a31beee (diff) | |
| download | PROJ-94e36270ca393bd7b107bf690f09fd8ec1cd046b.tar.gz PROJ-94e36270ca393bd7b107bf690f09fd8ec1cd046b.zip | |
Use nm units in builtins.gie. Remove backward looking comments in code.
| -rw-r--r-- | src/phi2.cpp | 10 | ||||
| -rw-r--r-- | src/tsfn.cpp | 3 | ||||
| -rw-r--r-- | test/gie/builtins.gie | 12 | ||||
| -rw-r--r-- | test/unit/pj_phi2_test.cpp | 9 |
4 files changed, 18 insertions, 16 deletions
diff --git a/src/phi2.cpp b/src/phi2.cpp index b9b37765..0fdca47c 100644 --- a/src/phi2.cpp +++ b/src/phi2.cpp @@ -116,6 +116,7 @@ double pj_phi2(projCtx ctx, const double ts0, const double e) { * Determine latitude angle phi-2. * Inputs: * ts = exp(-psi) where psi is the isometric latitude (dimensionless) + * this variable is defined in Snyder (1987), Eq. (7-10) * e = eccentricity of the ellipsoid (dimensionless) * Output: * phi = geographic latitude (radians) @@ -123,13 +124,12 @@ double pj_phi2(projCtx ctx, const double ts0, const double e) { * psi = log( tan(pi/4 + phi/2) * * ( (1 - e*sin(phi)) / (1 + e*sin(phi)) )^(e/2) ) * = asinh(tan(phi)) - e * atanh(e * sin(phi)) + * = asinh(tan(chi)) + * chi = conformal latitude * - * OLD: This routine inverts this relation using the iterative scheme given - * by Snyder (1987), Eqs. (7-9) - (7-11). + * This routine converts t = exp(-psi) to * - * NEW: This routine converts t = exp(-psi) to - * - * tau' = sinh(psi) = (1/t - t)/2 + * tau' = tan(chi) = sinh(psi) = (1/t - t)/2 * * returns atan(sinpsi2tanphi(tau')) ***************************************************************************/ diff --git a/src/tsfn.cpp b/src/tsfn.cpp index a0960a66..8ed258d6 100644 --- a/src/tsfn.cpp +++ b/src/tsfn.cpp @@ -11,10 +11,13 @@ double pj_tsfn(double phi, double sinphi, double e) { * e = eccentricity of the ellipsoid (dimensionless) * Output: * ts = exp(-psi) where psi is the isometric latitude (dimensionless) + * = 1 / (tan(chi) + sec(chi)) * Here isometric latitude is defined by * psi = log( tan(pi/4 + phi/2) * * ( (1 - e*sin(phi)) / (1 + e*sin(phi)) )^(e/2) ) * = asinh(tan(phi)) - e * atanh(e * sin(phi)) + * = asinh(tan(chi)) + * chi = conformal latitude ***************************************************************************/ double cosphi = cos(phi); diff --git a/test/gie/builtins.gie b/test/gie/builtins.gie index 2432ccb0..1ec59b7a 100644 --- a/test/gie/builtins.gie +++ b/test/gie/builtins.gie @@ -1425,7 +1425,7 @@ expect -0.001790143 -0.000895247 ------------------------------------------------------------------------------- operation +proj=etmerc +ellps=GRS80 ------------------------------------------------------------------------------- -tolerance 50e-9 m +tolerance 50 nm accept 2 1 expect 222650.796797586 110642.229411933 accept 2 -1 @@ -3369,7 +3369,7 @@ operation +proj=merc +ellps=GRS80 tolerance 0 m accept 0 0 expect 0 0 -tolerance 50e-9 m +tolerance 50 nm accept 2 1 expect 222638.981586547 110579.965218249 accept 2 -1 @@ -3389,7 +3389,7 @@ direction inverse tolerance 0 m accept 0 0 expect 0 0 -tolerance 50e-9 m +tolerance 50 nm accept 200 100 expect 0.00179663056824 0.00090436947704 accept 200 -100 @@ -3413,7 +3413,7 @@ operation +proj=merc +R=6400000 tolerance 0 m accept 0 0 expect 0 0 -tolerance 50e-9 m +tolerance 50 nm accept 2 1 expect 223402.144255274 111706.743574944 accept 2 -1 @@ -3427,7 +3427,7 @@ direction inverse tolerance 0 m accept 0 0 expect 0 0 -tolerance 50e-9 m +tolerance 50 nm accept 200 100 expect 0.00179049310978 0.00089524655486 accept 200 -100 @@ -5700,7 +5700,7 @@ expect -0.001790143 0.511651393 ------------------------------------------------------------------------------- operation +proj=tmerc +ellps=GRS80 ------------------------------------------------------------------------------- -tolerance 50e-9 m +tolerance 50 nm accept 2 1 expect 222650.796797586 110642.229411933 accept 2 -1 diff --git a/test/unit/pj_phi2_test.cpp b/test/unit/pj_phi2_test.cpp index f344a3d0..fdedae98 100644 --- a/test/unit/pj_phi2_test.cpp +++ b/test/unit/pj_phi2_test.cpp @@ -39,15 +39,14 @@ namespace { TEST(PjPhi2Test, Basic) { projCtx ctx = pj_get_default_ctx(); - // Remove tests with |e| >= 1. Expectation is that only sane values of e - // (and nan is here reckoned to be sane) are passed to pj_phi2. Thus the - // return value with other values of e is "implementation dependent". + // Expectation is that only sane values of e (and nan is here reckoned to + // be sane) are passed to pj_phi2. Thus the return value with other values + // of e is "implementation dependent". constexpr auto inf = std::numeric_limits<double>::infinity(); constexpr auto nan = std::numeric_limits<double>::quiet_NaN(); - // Use EXPECT_EQ instead of EXPECT_DOUBLE_EQ. Strict equality is demanded - // here. + // Strict equality is demanded here. EXPECT_EQ( M_PI_2, pj_phi2(ctx, +0.0, 0.0)); EXPECT_EQ( 0.0 , pj_phi2(ctx, 1.0, 0.0)); EXPECT_EQ(-M_PI_2, pj_phi2(ctx, inf, 0.0)); |
