diff options
| author | Frank Warmerdam <warmerdam@pobox.com> | 2002-05-30 13:40:55 +0000 |
|---|---|---|
| committer | Frank Warmerdam <warmerdam@pobox.com> | 2002-05-30 13:40:55 +0000 |
| commit | f94b4a77d96ede45af76ada8223b915cbb68023d (patch) | |
| tree | 0cfded56aa946ca16ebf81f62057e099bf400db9 | |
| parent | fff37a106352de2e859829710ba2f8e272cd41d8 (diff) | |
| download | PROJ-f94b4a77d96ede45af76ada8223b915cbb68023d.tar.gz PROJ-f94b4a77d96ede45af76ada8223b915cbb68023d.zip | |
use less conflicting names for a, S and f
git-svn-id: http://svn.osgeo.org/metacrs/proj/trunk@1015 4e78687f-474d-0410-85f9-8d5e500ac6b2
| -rw-r--r-- | src/geod.c | 12 | ||||
| -rw-r--r-- | src/geod_for.c | 6 | ||||
| -rw-r--r-- | src/geod_inv.c | 6 | ||||
| -rw-r--r-- | src/geod_set.c | 16 | ||||
| -rw-r--r-- | src/geodesic.h | 8 |
5 files changed, 25 insertions, 23 deletions
@@ -52,7 +52,7 @@ do_geod(void) { phil = phi2; laml = lam2; printLL(phi1, lam1); putchar('\n'); - for ( S = del_S = S / n_S; --n_S; S += del_S) { + for ( geod_S = del_S = geod_S / n_S; --n_S; geod_S += del_S) { geod_for(); printLL(phi2, lam2); putchar('\n'); } @@ -84,7 +84,7 @@ process(FILE *fid) { geod_inv(); } else { al12 = dmstor(s, &s); - S = strtod(s, &s) * to_meter; + geod_S = strtod(s, &s) * to_meter; geod_pre(); geod_for(); } @@ -99,21 +99,21 @@ process(FILE *fid) { if (oform) { (void)printf(oform, al12 * RAD_TO_DEG); TAB; (void)printf(oform, al21 * RAD_TO_DEG); TAB; - (void)printf(osform, S * fr_meter); + (void)printf(osform, geod_S * fr_meter); } else { (void)fputs(rtodms(pline, al12, 0, 0), stdout); TAB; (void)fputs(rtodms(pline, al21, 0, 0), stdout); TAB; - (void)printf(osform, S * fr_meter); + (void)printf(osform, geod_S * fr_meter); } } else if (inverse) if (oform) { (void)printf(oform, al12 * RAD_TO_DEG); TAB; (void)printf(oform, al21 * RAD_TO_DEG); TAB; - (void)printf(osform, S * fr_meter); + (void)printf(osform, geod_S * fr_meter); } else { (void)fputs(rtodms(pline, al12, 0, 0), stdout); TAB; (void)fputs(rtodms(pline, al21, 0, 0), stdout); TAB; - (void)printf(osform, S * fr_meter); + (void)printf(osform, geod_S * fr_meter); } else { printLL(phi2, lam2); TAB; diff --git a/src/geod_for.c b/src/geod_for.c index 3411f0f5..5fe2021b 100644 --- a/src/geod_for.c +++ b/src/geod_for.c @@ -32,7 +32,7 @@ geod_pre(void) { D *= D; P = c2 / D; } else { - c1 = f * M; + c1 = geod_f * M; c2 = f4 * (1. - M * M); D = (1. - c2)*(1. - c2 - c1 * M); P = (1. + .5 * c1 * M) * c2 / D; @@ -50,7 +50,7 @@ geod_for(void) { double d,sind,u,V,X,ds,cosds,sinds,ss,de; if (ellipse) { - d = S / (D * a); + d = geod_S / (D * geod_a); if (signS) d = -d; u = 2. * (s1 - d); V = cos(u + d); @@ -58,7 +58,7 @@ geod_for(void) { ds = d + X - 2. * P * V * (1. - 2. * P * cos(u)) * sind; ss = s1 + s1 - ds; } else { - ds = S / a; + ds = geod_S / geod_a; if (signS) ds = - ds; } cosds = cos(ds); diff --git a/src/geod_inv.c b/src/geod_inv.c index f41d58af..81c6ab59 100644 --- a/src/geod_inv.c +++ b/src/geod_inv.c @@ -20,7 +20,7 @@ geod_inv(void) { dthm = .5 * (th2 - th1); dlamm = .5 * ( dlam = adjlon(lam2 - lam1) ); if (fabs(dlam) < DTOL && fabs(dthm) < DTOL) { - al12 = al21 = S = 0.; + al12 = al21 = geod_S = 0.; return; } sindlamm = sin(dlamm); @@ -42,14 +42,14 @@ geod_inv(void) { D = 4. * T * T; A = D * E; B = D + D; - S = a * sind * (T - f4 * (T * X - Y) + + geod_S = geod_a * sind * (T - f4 * (T * X - Y) + f64 * (X * (A + (T - .5 * (A - E)) * X) - Y * (B + E * Y) + D * X * Y)); tandlammp = tan(.5 * (dlam - .25 * (Y + Y - E * (4. - X)) * (f2 * T + f64 * (32. * T - (20. * T - A) * X - (B + 4.) * Y)) * tan(dlam))); } else { - S = a * d; + geod_S = geod_a * d; tandlammp = tan(dlamm); } u = atan2(sindthm , (tandlammp * costhm)); diff --git a/src/geod_set.c b/src/geod_set.c index 76cea729..2f00e9c2 100644 --- a/src/geod_set.c +++ b/src/geod_set.c @@ -19,7 +19,7 @@ geod_set(int argc, char **argv) { else start = curr = pj_mkparam(argv[i]); /* set elliptical parameters */ - if (pj_ell_set(start, &a, &es)) emess(1,"ellipse setup failure"); + if (pj_ell_set(start, &geod_a, &es)) emess(1,"ellipse setup failure"); /* set units */ if (name = pj_param(start, "sunits").s) { char *s; @@ -32,13 +32,13 @@ geod_set(int argc, char **argv) { to_meter = fr_meter = 1.; if (ellipse = es != 0.) { onef = sqrt(1. - es); - f = 1 - onef; - f2 = f/2; - f4 = f/4; - f64 = f*f/64; + geod_f = 1 - onef; + f2 = geod_f/2; + f4 = geod_f/4; + f64 = geod_f*geod_f/64; } else { onef = 1.; - f = f2 = f4 = f64 = 0.; + geod_f = f2 = f4 = f64 = 0.; } /* check if line or arc mode */ if (pj_param(start, "tlat_1").i) { @@ -51,7 +51,7 @@ geod_set(int argc, char **argv) { lam2 = pj_param(start, "rlon_2").f; geod_inv(); geod_pre(); - } else if (S = pj_param(start, "dS").f) { + } else if (geod_S = pj_param(start, "dS").f) { al12 = pj_param(start, "rA").f; geod_pre(); geod_for(); @@ -60,7 +60,7 @@ geod_set(int argc, char **argv) { if (!(del_alpha = pj_param(start, "rdel_A").f)) emess(1,"del azimuth == 0"); } else if (del_S = fabs(pj_param(start, "ddel_S").f)) { - n_S = S / del_S + .5; + n_S = geod_S / del_S + .5; } else if ((n_S = pj_param(start, "in_S").i) <= 0) emess(1,"no interval divisor selected"); } diff --git a/src/geodesic.h b/src/geodesic.h index fc161f3b..825b6925 100644 --- a/src/geodesic.h +++ b/src/geodesic.h @@ -16,21 +16,23 @@ struct geodesic { double ONEF, FLAT, FLAT2, FLAT4, FLAT64; int ELLIPSE; } GEODESIC; -# define a GEODESIC.A + +# define geod_a GEODESIC.A # define lam1 GEODESIC.LAM1 # define phi1 GEODESIC.PHI1 # define al12 GEODESIC.ALPHA12 # define lam2 GEODESIC.LAM2 # define phi2 GEODESIC.PHI2 # define al21 GEODESIC.ALPHA21 -# define S GEODESIC.DIST -# define f GEODESIC.FLAT +# define geod_S GEODESIC.DIST +# define geod_f GEODESIC.FLAT # define onef GEODESIC.ONEF # define f2 GEODESIC.FLAT2 # define f4 GEODESIC.FLAT4 # define ff2 GEODESIC.FLAT4 # define f64 GEODESIC.FLAT64 # define ellipse GEODESIC.ELLIPSE + int n_alpha, n_S; double |
