Statistics
| Revision:

svn-gvsig-desktop / tags / v1_10_0_Build_1257 / libraries / libjni-proj4 / src / PJ_rpoly.c @ 42039

History | View | Annotate | Download (885 Bytes)

1
#ifndef lint
2
static const char SCCSID[]="@(#)PJ_rpoly.c        4.1        94/02/15        GIE        REL";
3
#endif
4
#define PROJ_PARMS__ \
5
        double        phi1; \
6
        double        fxa; \
7
        double        fxb; \
8
        int                mode;
9
#define EPS        1e-9
10
#define PJ_LIB__
11
#include        <projects.h>
12
PROJ_HEAD(rpoly, "Rectangular Polyconic")
13
        "\n\tConic, Sph., no inv.\n\tlat_ts=";
14
FORWARD(s_forward); /* spheroid */
15
        double fa;
16

    
17
        if (P->mode)
18
                fa = tan(lp.lam * P->fxb) * P->fxa;
19
        else
20
                fa = 0.5 * lp.lam;
21
        if (fabs(lp.phi) < EPS) {
22
                xy.x = fa + fa;
23
                xy.y = - P->phi0;
24
        } else {
25
                xy.y = 1. / tan(lp.phi);
26
                xy.x = sin(fa = 2. * atan(fa * sin(lp.phi))) * xy.y;
27
                xy.y = lp.phi - P->phi0 + (1. - cos(fa)) * xy.y;
28
        }
29
        return (xy);
30
}
31
FREEUP; if (P) pj_dalloc(P); }
32
ENTRY0(rpoly)
33
        if ((P->mode = (P->phi1 = fabs(pj_param(P->params, "rlat_ts").f)) > EPS)) {
34
                P->fxb = 0.5 * sin(P->phi1);
35
                P->fxa = 0.5 / P->fxb;
36
        }
37
        P->es = 0.; P->fwd = s_forward;
38
ENDENTRY(P)