#include "../../shared/shared.h"
#include "./latlong.h"
#include <math.h>
Go to the source code of this file.
|
int | Ll2xyx (double *x, double *y, double *lat, double *lon, int ncoord, int sgn) |
|
int | Ll2xyx (double *x, double *y, double *lat, double *lon, int ncoord, int sgn, double central_meridian, double standard_parallel) |
|
void | Ll2xydef (double *pdelta, double *pslat, int sgn) |
|
◆ Ll2xyx() [1/2]
int Ll2xyx |
( |
double * |
x, |
|
|
double * |
y, |
|
|
double * |
lat, |
|
|
double * |
lon, |
|
|
int |
ncoord, |
|
|
int |
sgn |
|
) |
| |
Definition at line 8 of file Ll2xyx.cpp.
23 double central_meridian,standard_parallel;
25 Ll2xydef(¢ral_meridian,&standard_parallel,sgn);
27 return(
Ll2xyx(x,y,lat,lon,ncoord,sgn,central_meridian,standard_parallel));
◆ Ll2xyx() [2/2]
int Ll2xyx |
( |
double * |
x, |
|
|
double * |
y, |
|
|
double * |
lat, |
|
|
double * |
lon, |
|
|
int |
ncoord, |
|
|
int |
sgn, |
|
|
double |
central_meridian, |
|
|
double |
standard_parallel |
|
) |
| |
Definition at line 30 of file Ll2xyx.cpp.
49 double latitude,longitude;
50 double T,rho,sl,tc,mc;
52 if((sgn!=1) && (sgn!=-1))
_error_(
"Sign should be either +1 or -1.\n");
54 delta = central_meridian;
55 slat = standard_parallel;
65 for(i=0; i<ncoord; i++){
66 latitude = fabs(lat[i]) *
PI/180.;
67 longitude = (lon[i] + delta) *
PI/180.;
70 T = tan(
PI/4.-latitude/2.) / pow(((1.-ex*sin(latitude))/(1.+ex*sin(latitude))),(ex/2.));
72 if ((90. - slat) < 1.e-5)
73 rho = 2.*re*T/sqrt(pow((1.+ex),(1.+ex))*pow((1.-ex),(1.-ex)));
76 tc = tan(
PI/4.-sl/2.)/pow(((1.-ex*sin(sl))/(1.+ex*sin(sl))),(ex/2.));
77 mc = cos(sl)/sqrt(1.0-ex2*(pow(sin(sl),2)));
81 y[i]= -rho*(double)sgn*cos(sgn*longitude);
82 x[i]= rho*(double)sgn*sin(sgn*longitude);
84 if (latitude>=
PI/2.){
◆ Ll2xydef()
void Ll2xydef |
( |
double * |
pdelta, |
|
|
double * |
pslat, |
|
|
int |
sgn |
|
) |
| |
Definition at line 93 of file Ll2xyx.cpp.
114 if(flag)
_printf0_(
"Info: creating coordinates in polar stereographic (Std Latitude: 70N Meridian: 45).\n");
116 else if (sgn == -1) {
119 if(flag)
_printf0_(
"Info: creating coordinates in polar stereographic (Std Latitude: 71S Meridian: 0).\n");
121 else _error_(
"Sign should be either +1 or -1.\n");
int Ll2xyx(double *x, double *y, double *lat, double *lon, int ncoord, int sgn)