コード例 #1
0
ファイル: gvnspfor.c プロジェクト: Kylia669/DiplomWork
/* Initialize the General Vertical Near-Side Perspective projection
  ---------------------------------------------------------------*/
long gvnspforint
(
    double r, 			/* (I) Radius of the earth (sphere) 	*/
    double h,			/* height above sphere			*/
    double center_long,		/* (I) Center longitude 		*/
    double center_lat,		/* (I) Center latitude 			*/
    double false_east,		/* x offset in meters			*/
    double false_north		/* y offset in meters			*/
)
{
/* Place parameters in static storage for common use
  -------------------------------------------------*/
R = r;
p = 1.0 + h / R;
lon_center = center_long;
false_easting = false_east;
false_northing = false_north;
gctp_sincos(center_lat, &sin_p15, &cos_p15);

/* Report parameters to the user
  -----------------------------*/
ptitle("GENERAL VERTICAL NEAR-SIDE PERSPECTIVE"); 
radius(r);
genrpt(h,"Height of Point Above Surface of Sphere:   ");
cenlon(center_long);
cenlat(center_lat);
offsetp(false_easting,false_northing);
return(GCTP_OK);
}
コード例 #2
0
ファイル: lamazfor.c プロジェクト: Kylia669/DiplomWork
/* Initialize the Lambert Azimuthal Equal Area projection
  ------------------------------------------------------*/
long lamazforint
(
    double r, 			/* (I) Radius of the earth (sphere) 	*/
    double center_long,		/* (I) Center longitude 		*/
    double center_lat,		/* (I) Center latitude 			*/
    double false_east,		/* x offset in meters			*/
    double false_north		/* y offset in meters			*/
)
{
/* Place parameters in static storage for common use
  -------------------------------------------------*/
R = r;
lon_center = center_long;
false_easting = false_east;
false_northing = false_north;
gctp_sincos(center_lat, &sin_lat_o, &cos_lat_o);

/* Report parameters to the user
  -----------------------------*/
ptitle("LAMBERT AZIMUTHAL EQUAL-AREA"); 
radius(r);
cenlon(center_long);
cenlat(center_lat);
offsetp(false_easting,false_northing);
return(GCTP_OK);
}
コード例 #3
0
ファイル: alconinv.c プロジェクト: Kylia669/DiplomWork
/* Initialize the ALASKA CONFORMAL projection
  -----------------------------------------*/
long alconinvint
(
    double r_maj, 			/* Major axis			 	*/
    double r_min, 			/* Minor axis			 	*/
    double false_east,		/* x offset in meters			*/
    double false_north		/* y offset in meters			*/
)
{
double es;
double chi;
double esphi;

/* Place parameters in static storage for common use
  -------------------------------------------------*/
r_major = r_maj;
r_minor = r_min;
false_easting = false_east;
false_northing = false_north;
lon_center = -152.0 * D2R;
lat_center = 64.0 * D2R;
n = 6;

es = .006768657997291094;
e = sqrt(es);

         acoef[1]= 0.9945303;  
         acoef[2]= 0.0052083;   
         acoef[3]= 0.0072721;    
         acoef[4]= -0.0151089;    
         acoef[5]= 0.0642675;      
         acoef[6]= 0.3582802;       
         bcoef[1]= 0.0;      
         bcoef[2]= -.0027404; 
         bcoef[3]= 0.0048181;  
         bcoef[4]= -0.1932526;  
         bcoef[5]= -0.1381226;
         bcoef[6]= -0.2884586; 
esphi = e * sin(lat_center);
chi = 2.0 * atan(tan((HALF_PI + lat_center)/2.0) * 
            pow(((1.0 - esphi)/(1.0 + esphi)),(e/2.0))) - HALF_PI;
gctp_sincos(chi,&sin_p26,&cos_p26);


/* Report parameters to the user
  -----------------------------*/
ptitle("ALASKA CONFORMAL"); 
radius2(r_major,r_minor);
cenlon(lon_center);
cenlat(lat_center);
offsetp(false_easting,false_northing);
return(GCTP_OK);
}
コード例 #4
0
ファイル: obleqfor.c プロジェクト: Kylia669/DiplomWork
long obleqforint
(
    double r,
    double center_long,
    double center_lat,
    double shape_m,
    double shape_n,
    double angle,
    double false_east,
    double false_north
)
{
/* Place parameters in static storage for common use
  -------------------------------------------------*/
R = r;
lon_center = center_long;
lat_o = center_lat;
m = shape_m;
n = shape_n;
theta = angle;
false_easting = false_east;
false_northing = false_north;

/* Report parameters to the user (to device set up prior to this call)
  -------------------------------------------------------------------*/
ptitle("OBLATED EQUAL-AREA");
radius(R);
cenlon(lon_center);
cenlat(lat_o);
genrpt(m,"Parameter m:      ");
genrpt(n,"Parameter n:      ");
genrpt(theta,"Theta:      ");
offsetp(false_easting,false_northing);

/* Calculate the sine and cosine of the latitude of the center of the map
   and store in static storage for common use.
  -------------------------------------------*/
gctp_sincos(lat_o, &sin_lat_o, &cos_lat_o);
return(GCTP_OK);
}
コード例 #5
0
ファイル: lamazfor.c プロジェクト: nextgis-borsch/lib_hdfeos2
/* Initialize the General Lambert Azimuthal Equal Area projection
  --------------------------------------------------------------*/
int lamazforint(
double r_maj,			/* major axis		        	*/
double r_min,			/* minor axis		        	*/
double center_long,		/* (I) Center longitude 		*/
double center_lat,		/* (I) Center latitude 			*/
double false_east,		/* x offset in meters			*/
double false_north)		/* y offset in meters			*/
{
/* Place parameters in static storage for common use
  -------------------------------------------------*/
R = r_maj;
 if(fabs(r_min) < EPSLN ) /* sphere */
   {
     r_major = r_maj;
     r_minor = r_maj;
   }
 else /* sphere or ellipsoide */
   {
     r_major = r_maj;
     r_minor = r_min;
   }

lon_center = center_long;
lat_center = center_lat;
false_easting = false_east;
false_northing = false_north;
tsincos(center_lat, &sin_lat_o, &cos_lat_o);
sinphi1 = sin_lat_o; 
cosphi1 = cos_lat_o;

es = 1.0 - SQUARE(r_minor / r_major);
e = sqrt(es);

 if(es < 0.00001)
   {
     ind = 1; /* sphere */
     qp = 2.0;
     q1 = 2.0;
   }
 else
   {
     ind = 0; /* ellipsoid */
     qp = (1.0 - es)* (((1.0/(1.0 - es))-(1.0/(2.0*e))*log((1.0 - e)/(1.0 + e))));
     
     if((fabs (lat_center - HALF_PI) <=  EPSLN ) || (fabs (lat_center + HALF_PI) <=  EPSLN ))
       {
	 /* no other constants needed for LA with North and South polar Aspects lat_center = 90 or -90*/
       }
     else
       {
	 tsincos(lat_center, &sinphi1, &cosphi1);
	 q1 = (1.0 - es) * ((sinphi1 / (1.0 - es * sinphi1 * sinphi1))
				- (1.0 / (2.0 * e)) * 
				log((1.0 - e * sinphi1)/(1.0 + e * sinphi1)));
	 Rq = r_major * sqrt(qp/2.0);
	 if(fabs(q1) >= fabs(qp))
	   {
	     beta1 = HALF_PI * (fabs(q1/qp)/(q1/qp));
	   }
	 else
	   {
	     beta1 = asinz(q1/qp);
	   }
	 tsincos(beta1, &sin_beta1, &cos_beta1);
	 m1 = cosphi1 / sqrt(1.0 - es * sinphi1 * sinphi1);
	 D = (r_major * m1)/ (Rq * cos_beta1);
       }
   }

/* Report parameters to the user
  -----------------------------*/
ptitle("LAMBERT AZIMUTHAL EQUAL-AREA"); 
radius2(r_major, r_minor);
cenlon(center_long);
cenlat(center_lat);
offsetp(false_easting,false_northing);
return(OK);
}