svn-gvsig-desktop / tags / v1_9_Build_1241 / libraries / libjni-proj4 / src / PJ_tcea.c @ 34066
History | View | Annotate | Download (727 Bytes)
1 |
#ifndef lint
|
---|---|
2 |
static const char SCCSID[]="@(#)PJ_tcea.c 4.1 94/02/15 GIE REL"; |
3 |
#endif
|
4 |
#define PROJ_PARMS__ \
|
5 |
double rk0;
|
6 |
#define PJ_LIB__
|
7 |
#include <projects.h> |
8 |
PROJ_HEAD(tcea, "Transverse Cylindrical Equal Area") "\n\tCyl, Sph"; |
9 |
FORWARD(s_forward); /* spheroid */
|
10 |
xy.x = P->rk0 * cos(lp.phi) * sin(lp.lam); |
11 |
xy.y = P->k0 * (atan2(tan(lp.phi), cos(lp.lam)) - P->phi0); |
12 |
return (xy);
|
13 |
} |
14 |
INVERSE(s_inverse); /* spheroid */
|
15 |
double t;
|
16 |
|
17 |
xy.y = xy.y * P->rk0 + P->phi0; |
18 |
xy.x *= P->k0; |
19 |
t = sqrt(1. - xy.x * xy.x);
|
20 |
lp.phi = asin(t * sin(xy.y)); |
21 |
lp.lam = atan2(xy.x, t * cos(xy.y)); |
22 |
return (lp);
|
23 |
} |
24 |
FREEUP; if (P) pj_dalloc(P); }
|
25 |
ENTRY0(tcea) |
26 |
P->rk0 = 1 / P->k0;
|
27 |
P->inv = s_inverse; |
28 |
P->fwd = s_forward; |
29 |
P->es = 0.;
|
30 |
ENDENTRY(P) |