/Proj4/PJ_wag3.c

http://github.com/route-me/route-me · C · 27 lines · 26 code · 1 blank · 0 comment · 1 complexity · 10c3870c9cbcfa60e7d8b463ecb755ec MD5 · raw file

  1. #ifndef lint
  2. static const char SCCSID[]="@(#)PJ_wag3.c 4.1 94/02/15 GIE REL";
  3. #endif
  4. #define PROJ_PARMS__ \
  5. double C_x;
  6. #define PJ_LIB__
  7. # include "projects.h"
  8. PROJ_HEAD(wag3, "Wagner III") "\n\tPCyl., Sph.\n\tlat_ts=";
  9. #define TWOTHIRD 0.6666666666666666666667
  10. FORWARD(s_forward); /* spheroid */
  11. xy.x = P->C_x * lp.lam * cos(TWOTHIRD * lp.phi);
  12. xy.y = lp.phi;
  13. return (xy);
  14. }
  15. INVERSE(s_inverse); /* spheroid */
  16. lp.phi = xy.y;
  17. lp.lam = xy.x / (P->C_x * cos(TWOTHIRD * lp.phi));
  18. return (lp);
  19. }
  20. FREEUP; if (P) pj_dalloc(P); }
  21. ENTRY0(wag3)
  22. double ts;
  23. ts = pj_param(P->params, "rlat_ts").f;
  24. P->C_x = cos(ts) / cos(2.*ts/3.);
  25. P->es = 0.; P->inv = s_inverse; P->fwd = s_forward;
  26. ENDENTRY(P)