aboutsummaryrefslogtreecommitdiff
path: root/src/projections/bipc.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/bipc.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/bipc.cpp')
-rw-r--r--src/projections/bipc.cpp15
1 files changed, 10 insertions, 5 deletions
diff --git a/src/projections/bipc.cpp b/src/projections/bipc.cpp
index 9e991ecc..bf4ba834 100644
--- a/src/projections/bipc.cpp
+++ b/src/projections/bipc.cpp
@@ -54,7 +54,8 @@ static PJ_XY bipc_s_forward (PJ_LP lp, PJ *P) { /* Spheroidal, forward
Az = atan2(sdlam , C45 * (tphi - cdlam));
}
if( (tag = (Az > Azba)) ) {
- cdlam = cos(sdlam = lp.lam + R110);
+ sdlam = lp.lam + R110;
+ cdlam = cos(sdlam);
sdlam = sin(sdlam);
z = S20 * sphi + C20 * cphi * cdlam;
if (fabs(z) > 1.) {
@@ -86,7 +87,8 @@ static PJ_XY bipc_s_forward (PJ_LP lp, PJ *P) { /* Spheroidal, forward
proj_errno_set(P, PJD_ERR_TOLERANCE_CONDITION);
return xy;
}
- r = F * (t = pow(tan(.5 * z), n));
+ t = pow(tan(.5 * z), n);
+ r = F * t;
if ((al = .5 * (R104 - z)) < 0.) {
proj_errno_set(P, PJD_ERR_TOLERANCE_CONDITION);
return xy;
@@ -100,7 +102,8 @@ static PJ_XY bipc_s_forward (PJ_LP lp, PJ *P) { /* Spheroidal, forward
else al = al < 0. ? -1. : 1.;
} else
al = acos(al);
- if (fabs(t = n * (Av - Az)) < al)
+ t = n * (Av - Az);
+ if (fabs(t) < al)
r /= cos(al + (tag ? t : -t));
xy.x = r * sin(t);
xy.y += (tag ? -r : r) * cos(t);
@@ -135,8 +138,10 @@ static PJ_LP bipc_s_inverse (PJ_XY xy, PJ *P) { /* Spheroidal, inverse
c = C45;
Av = Azba;
}
- rl = rp = r = hypot(xy.x, xy.y);
- fAz = fabs(Az = atan2(xy.x, xy.y));
+ r = hypot(xy.x, xy.y);
+ rl = rp = r;
+ Az = atan2(xy.x, xy.y);
+ fAz = fabs(Az);
for (i = NITER; i ; --i) {
z = 2. * atan(pow(r / F,1 / n));
al = acos((pow(tan(.5 * z), n) +