Esempio n. 1
0
*/
#define PROJ_PARMS__ \
  void  *en, *en2; \
  double phi1; \
  double phit; \
  double n, kRF; \
  int czech;
#define PROJ_LIB__
#include  <lib_proj.h>
PROJ_HEAD(kocc, "Krovak Oblique Conformal Conic")
  "\n\tConic, Sph&Ell\n\tlat_1= lat_t=";

FORWARD(e_forward); /* ellipsoid */
  double rho, theta;

  lp = proj_translate(proj_gauss(lp, P->en), P->en2);
  rho = P->kRF / pow(tan(.5 * lp.phi + FORTPI), P->n);
  theta = P->n * lp.lam;
  if (P->czech) {  /* Czech grid mode */
    xy.x = rho * cos(theta);
    xy.y = - rho * sin(theta);
  } else { /* proper math mode */
    xy.x = rho * sin(theta);
    xy.y = - rho * cos(theta);
  }
  return (xy);
}
INVERSE(e_inverse); /* ellipsoid */
  double x, y, rho, theta;

  if (P->czech) {
Esempio n. 2
0
	double cosc0, sinc0; \
	double R2; \
	void *en;

#define PROJ_LIB__
#include	<lib_proj.h>

PROJ_HEAD(sterea, "Oblique Stereographic Alternative")
	"\n\tAzimuthal, Sph&Ell";
# define DEL_TOL	1.e-14
# define MAX_ITER	10

FORWARD(e_forward); /* ellipsoid */
	double cosc, sinc, cosl, k;

	lp = proj_gauss(lp, P->en);
	sinc = sin(lp.phi);
	cosc = cos(lp.phi);
	cosl = cos(lp.lam);
	k = P->k0 * P->R2 / (1. + P->sinc0 * sinc + P->cosc0 * cosc * cosl);
	xy.x = k * cosc * sin(lp.lam);
	xy.y = k * (P->cosc0 * sinc - P->sinc0 * cosc * cosl);
	return (xy);
}
INVERSE(e_inverse); /* ellipsoid */
	double rho, c, sinc, cosc;

	xy.x /= P->k0;
	xy.y /= P->k0;
	if((rho = hypot(xy.x, xy.y))) {
		c = 2. * atan2(rho, P->R2);