aboutsummaryrefslogtreecommitdiff
path: root/src/projections/airy.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/airy.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/airy.cpp')
-rw-r--r--src/projections/airy.cpp9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/projections/airy.cpp b/src/projections/airy.cpp
index 91b4b7a2..f7602e53 100644
--- a/src/projections/airy.cpp
+++ b/src/projections/airy.cpp
@@ -77,7 +77,8 @@ static PJ_XY airy_s_forward (PJ_LP lp, PJ *P) { /* Spheroidal, forward
proj_errno_set(P, PJD_ERR_TOLERANCE_CONDITION);
return xy;
}
- if (fabs(s = 1. - cosz) > EPS) {
+ s = 1. - cosz;
+ if (fabs(s) > EPS) {
t = 0.5 * (1. + cosz);
if(t == 0) {
proj_errno_set(P, PJD_ERR_TOLERANCE_CONDITION);
@@ -88,8 +89,7 @@ static PJ_XY airy_s_forward (PJ_LP lp, PJ *P) { /* Spheroidal, forward
Krho = 0.5 - Q->Cb;
xy.x = Krho * cosphi * sinlam;
if (Q->mode == OBLIQ)
- xy.y = Krho * (Q->cosph0 * sinphi -
- Q->sinph0 * cosphi * coslam);
+ xy.y = Krho * (Q->cosph0 * sinphi - Q->sinph0 * cosphi * coslam);
else
xy.y = Krho * sinphi;
break;
@@ -100,7 +100,8 @@ static PJ_XY airy_s_forward (PJ_LP lp, PJ *P) { /* Spheroidal, forward
proj_errno_set(P, PJD_ERR_TOLERANCE_CONDITION);
return xy;
}
- if ((lp.phi *= 0.5) > EPS) {
+ lp.phi *= 0.5;
+ if (lp.phi > EPS) {
t = tan(lp.phi);
Krho = -2.*(log(cos(lp.phi)) / t + t * Q->Cb);
xy.x = Krho * sinlam;