aboutsummaryrefslogtreecommitdiff
path: root/src/projections/airy.cpp
diff options
context:
space:
mode:
authorEven Rouault <even.rouault@spatialys.com>2020-03-06 20:38:38 +0100
committerEven Rouault <even.rouault@spatialys.com>2020-03-08 19:58:35 +0100
commit60d3df673ca224107eb63e459073fc11ab5f4f16 (patch)
tree52c871c17f0c98c90ce6415cdb79dc1e73c14f4d /src/projections/airy.cpp
parent38ec5e662a74d40e02e38dc5dca553c3ecb04356 (diff)
downloadPROJ-60d3df673ca224107eb63e459073fc11ab5f4f16.tar.gz
PROJ-60d3df673ca224107eb63e459073fc11ab5f4f16.zip
src/projections/: remove assignments in expression and multiple statements per line
Should hopefully result in no change in results, and hopefully more readable code...
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;