PageRenderTime 37ms CodeModel.GetById 28ms app.highlight 7ms RepoModel.GetById 1ms app.codeStats 0ms

/Proj4/PJ_putp5.c

http://github.com/route-me/route-me
C | 29 lines | 29 code | 0 blank | 0 comment | 1 complexity | 8f645f593c7b4b6304137393fafe15ce MD5 | raw file
 1#ifndef lint
 2static const char SCCSID[]="@(#)PJ_putp5.c	4.1	94/02/15	GIE	REL";
 3#endif
 4#define PROJ_PARMS__ \
 5	double	A, B;
 6#define PJ_LIB__
 7# include	"projects.h"
 8PROJ_HEAD(putp5, "Putnins P5") "\n\tPCyl., Sph.";
 9PROJ_HEAD(putp5p, "Putnins P5'") "\n\tPCyl., Sph.";
10#define C	1.01346
11#define D	1.2158542
12FORWARD(s_forward); /* spheroid */
13	xy.x = C * lp.lam * (P->A - P->B * sqrt(1. + D * lp.phi * lp.phi));
14	xy.y = C * lp.phi;
15	return (xy);
16}
17INVERSE(s_inverse); /* spheroid */
18	lp.phi = xy.y / C;
19	lp.lam = xy.x / (C * (P->A - P->B * sqrt(1. + D * lp.phi * lp.phi)));
20	return (lp);
21}
22FREEUP; if (P) pj_dalloc(P); }
23	static PJ *
24setup(PJ *P) {
25	P->es = 0.; P->inv = s_inverse; P->fwd = s_forward;
26	return P;
27}
28ENTRY0(putp5) P->A = 2.; P->B = 1.; ENDENTRY(setup(P))
29ENTRY0(putp5p) P->A = 1.5; P->B = 0.5; ENDENTRY(setup(P))