PageRenderTime 34ms CodeModel.GetById 24ms app.highlight 8ms RepoModel.GetById 1ms app.codeStats 0ms

/Proj4/PJ_urmfps.c

http://github.com/route-me/route-me
C | 43 lines | 43 code | 0 blank | 0 comment | 4 complexity | b9ada8f892805fc460dc8d37a9494dd9 MD5 | raw file
 1#ifndef lint
 2static const char SCCSID[]="@(#)PJ_urmfps.c	4.1	94/02/15	GIE	REL";
 3#endif
 4#define PROJ_PARMS__ \
 5	double	n, C_y;
 6#define PJ_LIB__
 7#include	"projects.h"
 8PROJ_HEAD(urmfps, "Urmaev Flat-Polar Sinusoidal") "\n\tPCyl, Sph.\n\tn=";
 9PROJ_HEAD(wag1, "Wagner I (Kavraisky VI)") "\n\tPCyl, Sph.";
10#define C_x 0.8773826753
11#define Cy 1.139753528477
12FORWARD(s_forward); /* sphere */
13	lp.phi = aasin(P->n * sin(lp.phi));
14	xy.x = C_x * lp.lam * cos(lp.phi);
15	xy.y = P->C_y * lp.phi;
16	return (xy);
17}
18INVERSE(s_inverse); /* sphere */
19	xy.y /= P->C_y;
20	lp.phi = aasin(sin(xy.y) / P->n);
21	lp.lam = xy.x / (C_x * cos(xy.y));
22	return (lp);
23}
24FREEUP; if (P) pj_dalloc(P); }
25	static PJ *
26setup(PJ *P) {
27	P->C_y = Cy / P->n;
28	P->es = 0.;
29	P->inv = s_inverse;
30	P->fwd = s_forward;
31	return P;
32}
33ENTRY0(urmfps)
34	if (pj_param(P->params, "tn").i) {
35		P->n = pj_param(P->params, "dn").f;
36		if (P->n <= 0. || P->n > 1.)
37			E_ERROR(-40)
38	} else
39		E_ERROR(-40)
40ENDENTRY(setup(P))
41ENTRY0(wag1)
42	P->n = 0.8660254037844386467637231707;
43ENDENTRY(setup(P))