27 #define sm_a 6378137.0
28 #define sm_b 6356752.314
29 #define sm_EccSquared 6.69437999013e-03
30 #define UTMScaleFactor 0.9996
31 #define PI 3.14159265358979
49 if ( (zone < 1) || (zone > 60) )
50 zone = int(std::floor((lon + 180.0) / 6)) + 1;
70 static void UTMXYToLatLon (
double x,
double y,
int zone,
bool southhemi,
double& lat,
double& lon)
111 return (deg / 180.00 *
PI);
120 return (rad /
PI * 180.00);
130 if(rad >= 0 && rad <= 2*
PI -
eps)
155 double alpha, beta, gamma, delta, epsilon, n;
166 * (1.0 + ((n2) / 4.0) + ((n4) / 64.0));
169 beta = (-3.0 * n / 2.0) + (9.0 * (n3) / 16.0)
170 + (-3.0 * (n5) / 32.0);
173 gamma = (15.0 * (n2) / 16.0)
174 + (-15.0 * (n4) / 32.0);
177 delta = (-35.0 * (n3) / 48.0)
178 + (105.0 * (n5) / 256.0);
181 epsilon = (315.0 * (n4) / 512.0);
185 * (phi + (beta *
std::sin(2.0 * phi))
195 cmeridian =
DegToRad(-183.0 + ((
double)zone * 6.0));
200 double y_, alpha_, beta_, gamma_, delta_, epsilon_, n;
212 * (1 + ((n2) / 4) + ((n4) / 64));
218 beta_ = (3.0 * n / 2.0) + (-27.0 * (n3) / 32.0)
219 + (269.0 * (n5) / 512.0);
222 gamma_ = (21.0 * (n2) / 16.0)
223 + (-55.0 * (n4) / 32.0);
226 delta_ = (151.0 * (n3) / 96.0)
227 + (-417.0 * (n5) / 128.0);
230 epsilon_ = (1097.0 * (n4) / 512.0);
233 result = y_ + (beta_ *
std::sin(2.0 * y_))
241 static void MapLatLonToXY (
double phi,
double lambda,
double lambda0,
double &
x,
double &
y)
243 double N, nu2, ep2, t, t2, l;
244 double l3coef, l4coef, l5coef, l6coef, l7coef, l8coef;
260 l = lambda - lambda0;
266 l3coef = 1.0 - t2 + nu2;
268 l4coef = 5.0 - t2 + 9 * nu2 + 4.0 * (nu2 * nu2);
270 l5coef = 5.0 - 18.0 * t2 + (t2 * t2) + 14.0 * nu2
273 l6coef = 61.0 - 58.0 * t2 + (t2 * t2) + 270.0 * nu2
276 l7coef = 61.0 - 479.0 * t2 + 179.0 * (t2 * t2) - (t2 * t2 * t2);
278 l8coef = 1385.0 - 3111.0 * t2 + 543.0 * (t2 * t2) - (t2 * t2 * t2);
282 double cos_phi2 = cos_phi*cos_phi;
283 double cos_phi3 = cos_phi2 * cos_phi;
287 + (N / 6.0 * (cos_phi3) * l3coef * (l3))
288 + (N / 120.0 * (cos_phi3*cos_phi2) * l5coef * (l3*l2))
289 + (N / 5040.0 * (cos_phi3*cos_phi3*cos_phi) * l7coef * (l3*l3*l));
293 + (t / 2.0 * N * (cos_phi2) * (l2))
294 + (t / 24.0 * N * (cos_phi2*cos_phi2) * l4coef * (l3*l))
295 + (t / 720.0 * N * (cos_phi3*cos_phi3) * l6coef * (l3*l3))
296 + (t / 40320.0 * N * (cos_phi3*cos_phi3*cos_phi2) * l8coef * (l3*l3*l2));
300 static void MapXYToLatLon (
double x,
double y,
double lambda0,
double& phi,
double& lambda)
302 double phif, Nf, Nfpow, nuf2, ep2, tf, tf2, tf4, cf;
303 double x1frac, x2frac, x3frac, x4frac, x5frac, x6frac, x7frac, x8frac;
304 double x2poly, x3poly, x4poly, x5poly, x6poly, x7poly, x8poly;
317 nuf2 = ep2 * (cf*cf);
330 x1frac = 1.0 / (Nfpow * cf);
333 x2frac = tf / (2.0 * Nfpow);
336 x3frac = 1.0 / (6.0 * Nfpow * cf);
339 x4frac = tf / (24.0 * Nfpow);
342 x5frac = 1.0 / (120.0 * Nfpow * cf);
345 x6frac = tf / (720.0 * Nfpow);
348 x7frac = 1.0 / (5040.0 * Nfpow * cf);
351 x8frac = tf / (40320.0 * Nfpow);
355 x2poly = -1.0 - nuf2;
357 x3poly = -1.0 - 2 * tf2 - nuf2;
359 x4poly = 5.0 + 3.0 * tf2 + 6.0 * nuf2 - 6.0 * tf2 * nuf2
360 - 3.0 * (nuf2 *nuf2) - 9.0 * tf2 * (nuf2 * nuf2);
362 x5poly = 5.0 + 28.0 * tf2 + 24.0 * tf4 + 6.0 * nuf2 + 8.0 * tf2 * nuf2;
364 x6poly = -61.0 - 90.0 * tf2 - 45.0 * tf4 - 107.0 * nuf2
365 + 162.0 * tf2 * nuf2;
367 x7poly = -61.0 - 662.0 * tf2 - 1320.0 * tf4 - 720.0 * (tf4 * tf2);
369 x8poly = 1385.0 + 3633.0 * tf2 + 4095.0 * tf4 + 1575 * (tf4 * tf2);
372 phi = phif + x2frac * x2poly * (
x *
x)
373 + x4frac * x4poly * (
x*
x*
x*
x)
374 + x6frac * x6poly * (
x*
x*
x*
x*
x*
x)
375 + x8frac * x8poly * (
x*
x*
x*
x*
x*
x*
x*
x);
378 lambda = lambda0 + x1frac *
x
379 + x3frac * x3poly * (
x*
x*
x)
380 + x5frac * x5poly * (
x*
x*
x*
x*
x)
381 + x7frac * x7poly * (
x*
x*
x*
x*
x*
x*
x);
Definition: coordinateconversion.h:37
static void MapLatLonToXY(double phi, double lambda, double lambda0, double &x, double &y)
Definition: coordinateconversion.h:241
static double twoPIrange(double rad)
Definition: coordinateconversion.h:127
static void UTMXYToLatLonDegree(double x, double y, int zone, bool southhemi, double &lat, double &lon)
Definition: coordinateconversion.h:98
static void UTMXYToLatLon(double x, double y, int zone, bool southhemi, double &lat, double &lon)
Definition: coordinateconversion.h:70
static double ArcLengthOfMeridian(double phi)
Definition: coordinateconversion.h:153
static double UTMCentralMeridian(int zone)
Definition: coordinateconversion.h:192
static int LatLonToUTMXY(double lat, double lon, int zone, double &x, double &y)
Definition: coordinateconversion.h:47
static double FootpointLatitude(double y)
Definition: coordinateconversion.h:198
static double DegToRad(double deg)
Definition: coordinateconversion.h:109
static double RadToDeg(double rad)
Definition: coordinateconversion.h:118
static void MapXYToLatLon(double x, double y, double lambda0, double &phi, double &lambda)
Definition: coordinateconversion.h:300
#define UTMScaleFactor
Definition: coordinateconversion.h:30
#define PI
Definition: coordinateconversion.h:31
#define sm_b
Definition: coordinateconversion.h:28
#define sm_a
Definition: coordinateconversion.h:27
const double eps
Definition: cubic_piecewise_function.cpp:16
interval< T > cos(interval< T > x)
Definition: intervalarithmetic.h:225
interval< T > sin(interval< T > x)
Definition: intervalarithmetic.h:204
x
Definition: adore_set_goal.py:30
y
Definition: adore_set_goal.py:31
Definition: areaofeffectconverter.h:20