aboutsummaryrefslogtreecommitdiff
path: root/src/projections/rpoly.cpp
diff options
context:
space:
mode:
authorKristian Evers <kristianevers@gmail.com>2020-03-09 10:25:08 +0100
committerGitHub <noreply@github.com>2020-03-09 10:25:08 +0100
commit46c47e9adf6376ae06afabe5d24a0016a05ced82 (patch)
tree52c871c17f0c98c90ce6415cdb79dc1e73c14f4d /src/projections/rpoly.cpp
parent38ec5e662a74d40e02e38dc5dca553c3ecb04356 (diff)
parent60d3df673ca224107eb63e459073fc11ab5f4f16 (diff)
downloadPROJ-46c47e9adf6376ae06afabe5d24a0016a05ced82.tar.gz
PROJ-46c47e9adf6376ae06afabe5d24a0016a05ced82.zip
Merge pull request #2025 from rouault/projections_remove_assignments_in_expressions
src/projections/: remove assignments in expression and multiple statements per line
Diffstat (limited to 'src/projections/rpoly.cpp')
-rw-r--r--src/projections/rpoly.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/projections/rpoly.cpp b/src/projections/rpoly.cpp
index 58decf66..b065861f 100644
--- a/src/projections/rpoly.cpp
+++ b/src/projections/rpoly.cpp
@@ -34,7 +34,8 @@ static PJ_XY rpoly_s_forward (PJ_LP lp, PJ *P) { /* Spheroidal, forwar
xy.y = - P->phi0;
} else {
xy.y = 1. / tan(lp.phi);
- xy.x = sin(fa = 2. * atan(fa * sin(lp.phi))) * xy.y;
+ fa = 2. * atan(fa * sin(lp.phi));
+ xy.x = sin(fa) * xy.y;
xy.y = lp.phi - P->phi0 + (1. - cos(fa)) * xy.y;
}
return xy;
@@ -48,7 +49,9 @@ PJ *PROJECTION(rpoly) {
return pj_default_destructor(P, ENOMEM);
P->opaque = Q;
- if ((Q->mode = (Q->phi1 = fabs(pj_param(P->ctx, P->params, "rlat_ts").f)) > EPS)) {
+ Q->phi1 = fabs(pj_param(P->ctx, P->params, "rlat_ts").f);
+ Q->mode = Q->phi1 > EPS;
+ if (Q->mode) {
Q->fxb = 0.5 * sin(Q->phi1);
Q->fxa = 0.5 / Q->fxb;
}