aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPhilippe Rivière <fil@rezo.net>2018-09-21 22:42:58 +0200
committerPhilippe Rivière <fil@rezo.net>2018-09-21 22:42:58 +0200
commitc9962986f4c39219b614872ef5af9c8c7b8c7503 (patch)
tree1a6be41030d1a54dbe62fe9d55c1da61ddb4dac8
parent6b0567b3c01ada8412a446310af9784124453099 (diff)
downloadPROJ-c9962986f4c39219b614872ef5af9c8c7b8c7503.tar.gz
PROJ-c9962986f4c39219b614872ef5af9c8c7b8c7503.zip
coding style (https://travis-ci.com/OSGeo/proj.4/jobs/147225960 & https://travis-ci.com/OSGeo/proj.4/jobs/147274068)
-rw-r--r--src/PJ_bertin1953.c45
1 files changed, 23 insertions, 22 deletions
diff --git a/src/PJ_bertin1953.c b/src/PJ_bertin1953.c
index 19aa4d53..f273f0e9 100644
--- a/src/PJ_bertin1953.c
+++ b/src/PJ_bertin1953.c
@@ -31,23 +31,23 @@ static XY s_forward (LP lp, PJ *P) {
XY xy = {0.0,0.0};
struct pj_opaque *Q = P->opaque;
- // Projection constants
+ /* Projection constants */
double fu = 1.4, k = 12., w = 1.68;
- // Aliases
+ /* Aliases */
double lambda = lp.lam, phi = lp.phi;
- // Variable
+ /* Variable */
double d;
- // Apply rotation
+ /* Apply rotation */
+ double cosphi, x, y, z, z0;
lambda += Q->deltaLambda;
-
- double cosphi = cos(phi),
- x = cos(lambda) * cosphi,
- y = sin(lambda) * cosphi,
- z = sin(phi),
- z0 = z * Q->cosDeltaPhi + x * Q->sinDeltaPhi;
+ cosphi = cos(phi);
+ x = cos(lambda) * cosphi;
+ y = sin(lambda) * cosphi;
+ z = sin(phi);
+ z0 = z * Q->cosDeltaPhi + x * Q->sinDeltaPhi;
lambda = atan2(y * Q->cosDeltaGamma - z0 * Q->sinDeltaGamma,
x * Q->cosDeltaPhi - z * Q->sinDeltaPhi);
z0 = z0 * Q->cosDeltaGamma + y * Q->sinDeltaGamma;
@@ -55,20 +55,20 @@ static XY s_forward (LP lp, PJ *P) {
lambda = adjlon(lambda);
- // Adjust pre-projection
+ /* Adjust pre-projection */
if (lambda + phi < -fu) {
- double u = (lambda - phi + 1.6) * (lambda + phi + fu) / 8.;
- lambda += u;
- phi -= 0.8 * u * sin(phi + M_PI / 2.);
+ d = (lambda - phi + 1.6) * (lambda + phi + fu) / 8.;
+ lambda += d;
+ phi -= 0.8 * d * sin(phi + M_PI / 2.);
}
- // Project with Hammer (1.68,2)
+ /* Project with Hammer (1.68,2) */
cosphi = cos(phi);
d = sqrt(2./(1. + cosphi * cos(lambda / 2.)));
xy.x = w * d * cosphi * sin(lambda / 2.);
xy.y = d * sin(phi);
- // Adjust post-projection
+ /* Adjust post-projection */
d = (1. - cos(lambda * phi)) / k;
if (xy.y < 0.) {
xy.x *= 1. + d;
@@ -82,17 +82,18 @@ static XY s_forward (LP lp, PJ *P) {
PJ *PROJECTION(bertin1953) {
+ double deltaLambda, deltaPhi, deltaGamma;
struct pj_opaque *Q = pj_calloc (1, sizeof (struct pj_opaque));
if (0==Q)
return pj_default_destructor (P, ENOMEM);
P->opaque = Q;
- // force +lon_0 = -16.5
- double deltaLambda = P->lam0 -16.5 / 180. * M_PI;
+ /* force +lon_0 = -16.5 */
+ deltaLambda = P->lam0 -16.5 / 180. * M_PI;
- // force +lat_0=-42
- double deltaPhi = -42. / 180. * M_PI,
- deltaGamma = 0. / 180. * M_PI;
+ /* force +lat_0=-42 */
+ deltaPhi = -42. / 180. * M_PI;
+ deltaGamma = 0. / 180. * M_PI;
Q->deltaLambda = deltaLambda;
Q->cosDeltaPhi = cos(deltaPhi);
@@ -102,7 +103,7 @@ PJ *PROJECTION(bertin1953) {
P->es = 0.;
P->fwd = s_forward;
- // P->inv = s_inverse;
+ /* P->inv = s_inverse; */
return P;
}