svn-gvsig-desktop / tags / v1_1_2_Build_1045 / libraries / libjni-proj4 / src / PJ_putp4p.c @ 38629
History | View | Annotate | Download (955 Bytes)
1 |
#ifndef lint
|
---|---|
2 |
static const char SCCSID[]="@(#)PJ_putp4p.c 4.1 94/02/15 GIE REL"; |
3 |
#endif
|
4 |
#define PROJ_PARMS__ \
|
5 |
double C_x, C_y;
|
6 |
#define PJ_LIB__
|
7 |
# include <projects.h> |
8 |
PROJ_HEAD(putp4p, "Putnins P4'") "\n\tPCyl., Sph."; |
9 |
PROJ_HEAD(weren, "Werenskiold I") "\n\tPCyl., Sph."; |
10 |
FORWARD(s_forward); /* spheroid */
|
11 |
lp.phi = aasin(0.883883476 * sin(lp.phi)); |
12 |
xy.x = P->C_x * lp.lam * cos(lp.phi); |
13 |
xy.x /= cos(lp.phi *= 0.333333333333333); |
14 |
xy.y = P->C_y * sin(lp.phi); |
15 |
return (xy);
|
16 |
} |
17 |
INVERSE(s_inverse); /* spheroid */
|
18 |
lp.phi = aasin(xy.y / P->C_y); |
19 |
lp.lam = xy.x * cos(lp.phi) / P->C_x; |
20 |
lp.phi *= 3.;
|
21 |
lp.lam /= cos(lp.phi); |
22 |
lp.phi = aasin(1.13137085 * sin(lp.phi)); |
23 |
return (lp);
|
24 |
} |
25 |
FREEUP; if (P) pj_dalloc(P); }
|
26 |
static PJ *
|
27 |
setup(PJ *P) { |
28 |
P->es = 0.; P->inv = s_inverse; P->fwd = s_forward;
|
29 |
return P;
|
30 |
} |
31 |
ENTRY0(putp4p) P->C_x = 0.874038744; P->C_y = 3.883251825; ENDENTRY(setup(P)) |
32 |
ENTRY0(weren) P->C_x = 1.; P->C_y = 4.442882938; ENDENTRY(setup(P)) |