aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorCharles Karney <charles.karney@sri.com>2020-10-26 19:03:26 -0400
committerCharles Karney <charles.karney@sri.com>2020-10-26 19:03:26 -0400
commit6bd7c777f8e789f8ea34a6aa68104ab44a31beee (patch)
tree5b71841c6d881096d212ceb3fe9eaa070e617af7 /src
parent75a8436b2491dbc1eebb196ea42b961fd011a52e (diff)
downloadPROJ-6bd7c777f8e789f8ea34a6aa68104ab44a31beee.tar.gz
PROJ-6bd7c777f8e789f8ea34a6aa68104ab44a31beee.zip
Fix/add some comments.
Diffstat (limited to 'src')
-rw-r--r--src/phi2.cpp2
-rw-r--r--src/projections/merc.cpp2
2 files changed, 3 insertions, 1 deletions
diff --git a/src/phi2.cpp b/src/phi2.cpp
index 7bbb5679..b9b37765 100644
--- a/src/phi2.cpp
+++ b/src/phi2.cpp
@@ -127,7 +127,7 @@ double pj_phi2(projCtx ctx, const double ts0, const double e) {
* OLD: This routine inverts this relation using the iterative scheme given
* by Snyder (1987), Eqs. (7-9) - (7-11).
*
- * NEW: This routine writes converts t = exp(-psi) to
+ * NEW: This routine converts t = exp(-psi) to
*
* tau' = sinh(psi) = (1/t - t)/2
*
diff --git a/src/projections/merc.cpp b/src/projections/merc.cpp
index e5da3967..39685478 100644
--- a/src/projections/merc.cpp
+++ b/src/projections/merc.cpp
@@ -13,6 +13,8 @@ PROJ_HEAD(webmerc, "Web Mercator / Pseudo Mercator") "\n\tCyl, Ell\n\t";
static PJ_XY merc_e_forward (PJ_LP lp, PJ *P) { /* Ellipsoidal, forward */
PJ_XY xy = {0.0,0.0};
xy.x = P->k0 * lp.lam;
+ // Instead of calling tan and sin, call sin and cos which the compiler
+ // optimizes to a single call to sincos.
double sphi = sin(lp.phi), cphi = cos(lp.phi);
xy.y = P->k0 * (asinh(sphi/cphi) - P->e * atanh(P->e * sphi));
return xy;