From 60d3df673ca224107eb63e459073fc11ab5f4f16 Mon Sep 17 00:00:00 2001 From: Even Rouault Date: Fri, 6 Mar 2020 20:38:38 +0100 Subject: src/projections/: remove assignments in expression and multiple statements per line Should hopefully result in no change in results, and hopefully more readable code... --- src/projections/eck4.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/projections/eck4.cpp') diff --git a/src/projections/eck4.cpp b/src/projections/eck4.cpp index df2caf42..76474401 100644 --- a/src/projections/eck4.cpp +++ b/src/projections/eck4.cpp @@ -28,8 +28,8 @@ static PJ_XY eck4_s_forward (PJ_LP lp, PJ *P) { /* Spheroidal, forward for (i = NITER; i ; --i) { c = cos(lp.phi); s = sin(lp.phi); - lp.phi -= V = (lp.phi + s * (c + 2.) - p) / - (1. + c * (c + 2.) - s * s); + V = (lp.phi + s * (c + 2.) - p) / (1. + c * (c + 2.) - s * s); + lp.phi -= V; if (fabs(V) < EPS) break; } @@ -46,10 +46,10 @@ static PJ_XY eck4_s_forward (PJ_LP lp, PJ *P) { /* Spheroidal, forward static PJ_LP eck4_s_inverse (PJ_XY xy, PJ *P) { /* Spheroidal, inverse */ PJ_LP lp = {0.0,0.0}; - double c; lp.phi = aasin(P->ctx,xy.y * RC_y); - lp.lam = xy.x / (C_x * (1. + (c = cos(lp.phi)))); + const double c = cos(lp.phi); + lp.lam = xy.x / (C_x * (1. + c)); lp.phi = aasin(P->ctx,(lp.phi + sin(lp.phi) * (c + 2.)) * RC_p); return lp; } -- cgit v1.2.3