2
static const char SCCSID[]="@(#)PJ_gstmerc.c 4.6 08/07/28 DGR IGN";
14
# include <projects.h>
15
PROJ_HEAD(gstmerc, "Gauss-Schreiber Transverse Mercator (aka Gauss-Laborde Reunion)")
16
"\n\tCyl, Sph&Ell\n\tlat_0= lon_0= k_0=";
17
FORWARD(s_forward); /* spheroid */
18
double L, Ls, sinLs1, Ls1;
20
Ls= P->c+P->n1*log(pj_tsfn(-1.0*lp.phi,-1.0*sin(lp.phi),P->e));
21
sinLs1= sin(L)/cosh(Ls);
22
Ls1= log(pj_tsfn(-1.0*asin(sinLs1),0.0,0.0));
23
xy.x= (P->XS + P->n2*Ls1)*P->ra;
24
xy.y= (P->YS + P->n2*atan(sinh(Ls)/cos(L)))*P->ra;
27
INVERSE(s_inverse); /* spheroid */
29
L= atan(sinh((xy.x - P->XS)*P->a/P->n2)/cos((xy.y - P->YS)*P->a/P->n2));
30
sinC= sin((xy.y - P->YS)*P->a/P->n2)/cosh((xy.x - P->XS)*P->a/P->n2);
31
LC= log(pj_tsfn(-1.0*asin(sinC),0.0,0.0));
33
lp.phi= -1.0*pj_phi2(exp((LC-P->c)/P->n1),P->e);
36
FREEUP; if (P) pj_dalloc(P); }
38
P->n1= sqrt(1.0+P->es*pow(cos(P->phi0),4.0)/(1.0-P->es));
39
P->phic= asin(sin(P->phi0)/P->n1);
40
P->c= log(pj_tsfn(-1.0*P->phic,0.0,0.0))
41
-P->n1*log(pj_tsfn(-1.0*P->phi0,-1.0*sin(P->phi0),P->e));
42
P->n2= P->k0*P->a*sqrt(1.0-P->es)/(1.0-P->es*sin(P->phi0)*sin(P->phi0));
44
P->YS= -1.0*P->n2*P->phic;