/Proj4/pj_qsfn.c

http://github.com/route-me/route-me · C · 19 lines · 16 code · 2 blank · 1 comment · 1 complexity · a9ad5a012919bbe464cc98ca01e7f796 MD5 · raw file

  1. /* determine small q */
  2. #ifndef lint
  3. static const char SCCSID[]="@(#)pj_qsfn.c 4.3 93/06/12 GIE REL";
  4. #endif
  5. #include <math.h>
  6. #include "projects.h"
  7. # define EPSILON 1.0e-7
  8. double
  9. pj_qsfn(double sinphi, double e, double one_es) {
  10. double con;
  11. if (e >= EPSILON) {
  12. con = e * sinphi;
  13. return (one_es * (sinphi / (1. - con * con) -
  14. (.5 / e) * log ((1. - con) / (1. + con))));
  15. } else
  16. return (sinphi + sinphi);
  17. }