PageRenderTime 51ms CodeModel.GetById 42ms app.highlight 5ms RepoModel.GetById 2ms app.codeStats 0ms

/Proj4/PJ_tcc.c

http://github.com/route-me/route-me
C | 20 lines | 19 code | 1 blank | 0 comment | 2 complexity | 7df9428b3c2ef92adecc286d71b80bc8 MD5 | raw file
 1#ifndef lint
 2static const char SCCSID[]="@(#)PJ_tcc.c	4.1	94/02/15	GIE	REL";
 3#endif
 4#define PROJ_PARMS__ \
 5	double ap;
 6#define EPS10 1.e-10
 7#define PJ_LIB__
 8#include	"projects.h"
 9PROJ_HEAD(tcc, "Transverse Central Cylindrical") "\n\tCyl, Sph, no inv.";
10FORWARD(s_forward); /* spheroid */
11	double b, bt;
12
13	b = cos(lp.phi) * sin(lp.lam);
14	if ((bt = 1. - b * b) < EPS10) F_ERROR;
15	xy.x = b / sqrt(bt);
16	xy.y = atan2(tan(lp.phi) , cos(lp.lam));
17	return (xy);
18}
19FREEUP; if (P) pj_dalloc(P); }
20ENTRY0(tcc) P->es = 0.; P->fwd = s_forward; ENDENTRY(P)