svn-gvsig-desktop / trunk / libraries / libjni-proj4 / src / PJ_boggs.c @ 7098
History | View | Annotate | Download (891 Bytes)
1 |
#ifndef lint
|
---|---|
2 |
static const char SCCSID[]="@(#)PJ_boggs.c 4.1 94/02/15 GIE REL"; |
3 |
#endif
|
4 |
#define PJ_LIB__
|
5 |
# include <projects.h> |
6 |
PROJ_HEAD(boggs, "Boggs Eumorphic") "\n\tPCyl., no inv., Sph."; |
7 |
# define NITER 20 |
8 |
# define EPS 1e-7 |
9 |
# define ONETOL 1.000001 |
10 |
# define FXC 2.00276 |
11 |
# define FXC2 1.11072 |
12 |
# define FYC 0.49931 |
13 |
# define FYC2 1.41421356237309504880 |
14 |
FORWARD(s_forward); /* spheroid */
|
15 |
double theta, th1, c;
|
16 |
int i;
|
17 |
|
18 |
theta = lp.phi; |
19 |
if (fabs(fabs(lp.phi) - HALFPI) < EPS)
|
20 |
xy.x = 0.;
|
21 |
else {
|
22 |
c = sin(theta) * PI; |
23 |
for (i = NITER; i; --i) {
|
24 |
theta -= th1 = (theta + sin(theta) - c) / |
25 |
(1. + cos(theta));
|
26 |
if (fabs(th1) < EPS) break; |
27 |
} |
28 |
theta *= 0.5; |
29 |
xy.x = FXC * lp.lam / (1. / cos(lp.phi) + FXC2 / cos(theta));
|
30 |
} |
31 |
xy.y = FYC * (lp.phi + FYC2 * sin(theta)); |
32 |
return (xy);
|
33 |
} |
34 |
FREEUP; if (P) pj_dalloc(P); }
|
35 |
ENTRY0(boggs) P->es = 0.; P->fwd = s_forward; ENDENTRY(P)
|