mirror of
https://github.com/tumic0/GPXSee.git
synced 2025-06-27 19:49:15 +02:00
Variables with underscores followed by a capital letter are prohibited by the C++ standard
Fixes #266
This commit is contained in:
@ -104,10 +104,10 @@ AlbersEqual::AlbersEqual(const Ellipsoid *ellipsoid, double standardParallel1,
|
||||
} else
|
||||
_n = sin_lat1;
|
||||
|
||||
_C = sqr_m1 + _n * q1;
|
||||
_c = sqr_m1 + _n * q1;
|
||||
_a_over_n = ellipsoid->radius() / _n;
|
||||
nq0 = _n * q0;
|
||||
_rho0 = (_C < nq0) ? 0 : _a_over_n * sqrt(_C - nq0);
|
||||
_rho0 = (_c < nq0) ? 0 : _a_over_n * sqrt(_c - nq0);
|
||||
}
|
||||
|
||||
PointD AlbersEqual::ll2xy(const Coordinates &c) const
|
||||
@ -131,7 +131,7 @@ PointD AlbersEqual::ll2xy(const Coordinates &c) const
|
||||
e_sin = _e * sin_lat;
|
||||
q = ALBERS_Q(sin_lat, ONE_MINUS_SQR(e_sin), e_sin);
|
||||
nq = _n * q;
|
||||
rho = (_C < nq) ? 0 : _a_over_n * sqrt(_C - nq);
|
||||
rho = (_c < nq) ? 0 : _a_over_n * sqrt(_c - nq);
|
||||
theta = _n * dlam;
|
||||
|
||||
return PointD(rho * sin(theta) + _falseEasting,
|
||||
@ -168,7 +168,7 @@ Coordinates AlbersEqual::xy2ll(const PointD &p) const
|
||||
if (rho != 0.0)
|
||||
theta = atan2(dx, rho0_minus_dy);
|
||||
rho_n = rho * _n;
|
||||
q = (_C - (rho_n * rho_n) / _a2) / _n;
|
||||
q = (_c - (rho_n * rho_n) / _a2) / _n;
|
||||
qc = 1 - ((_one_minus_es) / (_two_e)) * log((1.0 - _e) / (1.0 + _e));
|
||||
if (fabs(fabs(qc) - fabs(q)) > 1.0e-6) {
|
||||
q_over_2 = q / 2.0;
|
||||
|
@ -25,7 +25,7 @@ private:
|
||||
|
||||
double _a2;
|
||||
double _rho0;
|
||||
double _C;
|
||||
double _c;
|
||||
double _n;
|
||||
double _e;
|
||||
double _es;
|
||||
|
@ -15,16 +15,16 @@ Krovak::Krovak(const Ellipsoid *ellipsoid, double standardParallel,
|
||||
|
||||
_phiP = deg2rad(standardParallel);
|
||||
_e = sqrt(ellipsoid->es());
|
||||
_A = ellipsoid->radius() * sqrt(1.0 - ellipsoid->es())
|
||||
_a = ellipsoid->radius() * sqrt(1.0 - ellipsoid->es())
|
||||
/ (1.0 - ellipsoid->es() * sinPhiC2);
|
||||
_B = sqrt(1.0 + (ellipsoid->es() * cosPhiC4 / (1.0 - ellipsoid->es())));
|
||||
double gamma0 = asin(sinPhiC / _B);
|
||||
_b = sqrt(1.0 + (ellipsoid->es() * cosPhiC4 / (1.0 - ellipsoid->es())));
|
||||
double gamma0 = asin(sinPhiC / _b);
|
||||
_t0 = tan(M_PI_4 + gamma0 / 2.0) * pow((1.0 + _e * sinPhiC) /
|
||||
(1.0 - _e * sinPhiC), _e*_B / 2.0) / pow(tan(M_PI_4 + phiC/2.0), _B);
|
||||
(1.0 - _e * sinPhiC), _e*_b / 2.0) / pow(tan(M_PI_4 + phiC/2.0), _b);
|
||||
_n = sin(_phiP);
|
||||
_r0 = scale * _A / tan(_phiP);
|
||||
_FE = falseEasting;
|
||||
_FN = falseNorthing;
|
||||
_r0 = scale * _a / tan(_phiP);
|
||||
_fe = falseEasting;
|
||||
_fn = falseNorthing;
|
||||
_cosAlphaC = cos(alphaC);
|
||||
_sinAlphaC = sin(alphaC);
|
||||
_lambda0 = deg2rad(longitudeOrigin);
|
||||
@ -35,23 +35,23 @@ PointD Krovak::ll2xy(const Coordinates &c) const
|
||||
double phi = deg2rad(c.lat());
|
||||
double lambda = deg2rad(c.lon());
|
||||
double eSinPhi = _e * sin(phi);
|
||||
double U = 2.0 * (atan(_t0 * pow(tan(phi/2.0 + M_PI_4), _B)
|
||||
/ pow((1.0 + eSinPhi) / (1.0 - eSinPhi), _e * _B/2.0)) - M_PI_4);
|
||||
double U = 2.0 * (atan(_t0 * pow(tan(phi/2.0 + M_PI_4), _b)
|
||||
/ pow((1.0 + eSinPhi) / (1.0 - eSinPhi), _e * _b/2.0)) - M_PI_4);
|
||||
double cosU = cos(U);
|
||||
double V = _B * (_lambda0 - lambda);
|
||||
double V = _b * (_lambda0 - lambda);
|
||||
double T = asin(_cosAlphaC * sin(U) + _sinAlphaC * cosU * cos(V));
|
||||
double D = asin(cosU * sin(V) / cos(T));
|
||||
double theta = _n * D;
|
||||
double r = _r0 * pow(tan(M_PI_4 + _phiP/2.0), _n)
|
||||
/ pow(tan(T/2.0 + M_PI_4), _n);
|
||||
|
||||
return PointD(r * sin(theta) + _FE, r * cos(theta) + _FN);
|
||||
return PointD(r * sin(theta) + _fe, r * cos(theta) + _fn);
|
||||
}
|
||||
|
||||
Coordinates Krovak::xy2ll(const PointD &p) const
|
||||
{
|
||||
double Xp = p.y() - _FN;
|
||||
double Yp = p.x() - _FE;
|
||||
double Xp = p.y() - _fn;
|
||||
double Yp = p.x() - _fe;
|
||||
double Xp2 = Xp * Xp;
|
||||
double Yp2 = Yp * Yp;
|
||||
double r = sqrt(Xp2 + Yp2);
|
||||
@ -63,8 +63,8 @@ Coordinates Krovak::xy2ll(const PointD &p) const
|
||||
double V = asin(cos(T) * sin(D) / cos(U));
|
||||
double phi = U;
|
||||
for (int i = 0; i < 3; i++)
|
||||
phi = 2.0 * (atan(pow(_t0, -1.0/_B) * pow(tan(U/2.0 + M_PI_4), 1.0/_B)
|
||||
phi = 2.0 * (atan(pow(_t0, -1.0/_b) * pow(tan(U/2.0 + M_PI_4), 1.0/_b)
|
||||
* pow((1.0 + _e * sin(phi))/(1.0 - _e * sin(phi)), _e/2.0)) - M_PI_4);
|
||||
|
||||
return Coordinates(rad2deg(_lambda0 - V/_B), rad2deg(phi));
|
||||
return Coordinates(rad2deg(_lambda0 - V/_b), rad2deg(phi));
|
||||
}
|
||||
|
@ -18,8 +18,8 @@ public:
|
||||
virtual Coordinates xy2ll(const PointD &p) const;
|
||||
|
||||
private:
|
||||
double _e, _A, _B, _t0, _n, _r0, _phiP;
|
||||
double _cosAlphaC, _sinAlphaC, _lambda0, _FE, _FN;
|
||||
double _e, _a, _b, _t0, _n, _r0, _phiP;
|
||||
double _cosAlphaC, _sinAlphaC, _lambda0, _fe, _fn;
|
||||
};
|
||||
|
||||
class KrovakNE : public CT
|
||||
|
@ -11,8 +11,8 @@ LambertAzimuthal::LambertAzimuthal(const Ellipsoid *ellipsoid,
|
||||
{
|
||||
double lat0 = deg2rad(latitudeOrigin);
|
||||
|
||||
_falseEasting = falseEasting;
|
||||
_falseNorthing = falseNorthing;
|
||||
_fe = falseEasting;
|
||||
_fn = falseNorthing;
|
||||
_lon0 = deg2rad(longitudeOrigin);
|
||||
|
||||
_a = ellipsoid->radius();
|
||||
@ -25,8 +25,8 @@ LambertAzimuthal::LambertAzimuthal(const Ellipsoid *ellipsoid,
|
||||
_qP = (1.0 - _es) * ((1.0 / (1.0 - _es)) - ((1.0/(2.0*_e))
|
||||
* log((1.0 - _e) / (1.0 + _e))));
|
||||
_beta0 = asin(q0 / _qP);
|
||||
_Rq = _a * sqrt(_qP / 2.0);
|
||||
_D = _a * (cos(lat0) / sqrt(1.0 - _es * sin2(lat0))) / (_Rq * cos(_beta0));
|
||||
_rq = _a * sqrt(_qP / 2.0);
|
||||
_d = _a * (cos(lat0) / sqrt(1.0 - _es * sin2(lat0))) / (_rq * cos(_beta0));
|
||||
}
|
||||
|
||||
PointD LambertAzimuthal::ll2xy(const Coordinates &c) const
|
||||
@ -38,11 +38,11 @@ PointD LambertAzimuthal::ll2xy(const Coordinates &c) const
|
||||
- ((1.0/(2.0*_e)) * log((1.0 - _e * sin(lat)) / (1.0 + _e
|
||||
* sin(lat)))));
|
||||
double beta = asin(q / _qP);
|
||||
double B = _Rq * sqrt(2.0 / (1.0 + sin(_beta0) * sin(beta) + (cos(_beta0)
|
||||
double B = _rq * sqrt(2.0 / (1.0 + sin(_beta0) * sin(beta) + (cos(_beta0)
|
||||
* cos(beta) * cos(lon - _lon0))));
|
||||
|
||||
double x = _falseEasting + ((B * _D) * (cos(beta) * sin(lon - _lon0)));
|
||||
double y = _falseNorthing + (B / _D) * ((cos(_beta0) * sin(beta))
|
||||
double x = _fe + ((B * _d) * (cos(beta) * sin(lon - _lon0)));
|
||||
double y = _fn + (B / _d) * ((cos(_beta0) * sin(beta))
|
||||
- (sin(_beta0) * cos(beta) * cos(lon - _lon0)));
|
||||
|
||||
return PointD(x, y);
|
||||
@ -53,14 +53,14 @@ Coordinates LambertAzimuthal::xy2ll(const PointD &p) const
|
||||
double es4 = _es * _es;
|
||||
double es6 = _es * es4;
|
||||
|
||||
double rho = sqrt(sqr((p.x() - _falseEasting) / _D) + sqr(_D * (p.y()
|
||||
- _falseNorthing)));
|
||||
double C = 2.0 * asin(rho / (2.0*_Rq));
|
||||
double betaS = asin((cos(C) * sin(_beta0)) + ((_D * (p.y() -_falseNorthing)
|
||||
double rho = sqrt(sqr((p.x() - _fe) / _d) + sqr(_d * (p.y()
|
||||
- _fn)));
|
||||
double C = 2.0 * asin(rho / (2.0*_rq));
|
||||
double betaS = asin((cos(C) * sin(_beta0)) + ((_d * (p.y() -_fn)
|
||||
* sin(C) * cos(_beta0)) / rho));
|
||||
|
||||
double lon = _lon0 + atan((p.x() - _falseEasting) * sin(C) / (_D * rho
|
||||
* cos(_beta0) * cos(C) - sqr(_D) * (p.y() - _falseNorthing) * sin(_beta0)
|
||||
double lon = _lon0 + atan((p.x() - _fe) * sin(C) / (_d * rho
|
||||
* cos(_beta0) * cos(C) - sqr(_d) * (p.y() - _fn) * sin(_beta0)
|
||||
* sin(C)));
|
||||
double lat = betaS + ((_es/3.0 + 31.0*es4/180.0 + 517.0*es6/5040.0)
|
||||
* sin(2.0*betaS)) + ((23.0*es4/360.0 + 251.0*es6/3780.0) * sin(4.0*betaS))
|
||||
|
@ -18,9 +18,8 @@ public:
|
||||
|
||||
private:
|
||||
double _lon0;
|
||||
double _falseNorthing;
|
||||
double _falseEasting;
|
||||
double _a, _e, _es, _qP, _beta0, _Rq, _D;
|
||||
double _fn, _fe;
|
||||
double _a, _e, _es, _qP, _beta0, _rq, _d;
|
||||
};
|
||||
|
||||
#endif // LAMBERTAZIMUTHAL_H
|
||||
|
@ -8,7 +8,7 @@
|
||||
ObliqueStereographic::ObliqueStereographic(const Ellipsoid *ellipsoid,
|
||||
double latitudeOrigin, double longitudeOrigin, double scale,
|
||||
double falseEasting, double falseNorthing)
|
||||
: _FE(falseEasting), _FN(falseNorthing)
|
||||
: _fe(falseEasting), _fn(falseNorthing)
|
||||
{
|
||||
double lat0 = deg2rad(latitudeOrigin);
|
||||
double sinPhi0 = sin(lat0);
|
||||
@ -48,17 +48,17 @@ PointD ObliqueStereographic::ll2xy(const Coordinates &c) const
|
||||
double B = (1.0 + sin(chi) * _sinChi0 + cos(chi) * _cosChi0
|
||||
* cos(lambda - _lambda0));
|
||||
|
||||
return PointD(_FE + _twoRk0 * cos(chi) * sin(lambda - _lambda0) / B,
|
||||
_FN + _twoRk0 * (sin(chi) * _cosChi0 - cos(chi) * _sinChi0
|
||||
return PointD(_fe + _twoRk0 * cos(chi) * sin(lambda - _lambda0) / B,
|
||||
_fn + _twoRk0 * (sin(chi) * _cosChi0 - cos(chi) * _sinChi0
|
||||
* cos(lambda - _lambda0)) / B);
|
||||
}
|
||||
|
||||
Coordinates ObliqueStereographic::xy2ll(const PointD &p) const
|
||||
{
|
||||
double i = atan((p.x() - _FE) / (_h + (p.y() - _FN)));
|
||||
double j = atan((p.x() - _FE) / (_g - (p.y() - _FN))) - i;
|
||||
double i = atan((p.x() - _fe) / (_h + (p.y() - _fn)));
|
||||
double j = atan((p.x() - _fe) / (_g - (p.y() - _fn))) - i;
|
||||
|
||||
double chi = _chi0 + 2.0 * atan(((p.y() - _FN) - (p.x() - _FE) * tan(j/2.0))
|
||||
double chi = _chi0 + 2.0 * atan(((p.y() - _fn) - (p.x() - _fe) * tan(j/2.0))
|
||||
/ _twoRk0);
|
||||
double lambda = j + 2.0 * i + _lambda0;
|
||||
|
||||
|
@ -22,7 +22,7 @@ private:
|
||||
double _lambda0;
|
||||
double _n;
|
||||
double _c;
|
||||
double _FE, _FN;
|
||||
double _fe, _fn;
|
||||
double _twoRk0, _g, _h;
|
||||
};
|
||||
|
||||
|
Reference in New Issue
Block a user