10 #if !defined(GEOGRAPHICLIB_GEOCENTRIC_HPP)
11 #define GEOGRAPHICLIB_GEOCENTRIC_HPP 1
16 namespace GeographicLib {
73 static const size_t dim_ = 3;
74 static const size_t dim2_ = dim_ * dim_;
75 real _a, _f, _e2, _e2m, _e2a, _e4a, _maxrad;
76 static void Rotation(real sphi, real cphi, real slam, real clam,
77 real M[dim2_])
throw();
78 static void Rotate(real M[dim2_], real x, real y, real z,
79 real& X, real& Y, real& Z)
throw() {
82 X = M[0] * x + M[1] * y + M[2] * z;
83 Y = M[3] * x + M[4] * y + M[5] * z;
84 Z = M[6] * x + M[7] * y + M[8] * z;
90 x = M[0] * X + M[3] * Y + M[6] * Z;
91 y = M[1] * X + M[4] * Y + M[7] * Z;
92 z = M[2] * X + M[5] * Y + M[8] * Z;
95 real M[dim2_])
const throw();
97 real M[dim2_])
const throw();
131 void Forward(real lat, real lon, real h, real& X, real& Y, real& Z)
134 IntForward(lat, lon, h, X, Y, Z, NULL);
160 void Forward(real lat, real lon, real h, real& X, real& Y, real& Z,
161 std::vector<real>& M)
165 if (M.end() == M.begin() + dim2_) {
167 IntForward(lat, lon, h, X, Y, Z, t);
168 copy(t, t + dim2_, M.begin());
170 IntForward(lat, lon, h, X, Y, Z, NULL);
193 void Reverse(real X, real Y, real Z, real& lat, real& lon, real& h)
196 IntReverse(X, Y, Z, lat, lon, h, NULL);
222 void Reverse(real X, real Y, real Z, real& lat, real& lon, real& h,
223 std::vector<real>& M)
227 if (M.end() == M.begin() + dim2_) {
229 IntReverse(X, Y, Z, lat, lon, h, t);
230 copy(t, t + dim2_, M.begin());
232 IntReverse(X, Y, Z, lat, lon, h, NULL);
241 bool Init()
const throw() {
return _a > 0; }
247 {
return Init() ? _a : Math::NaN<real>(); }
254 {
return Init() ? _f : Math::NaN<real>(); }
263 {
return Init() ? 1/_f : Math::NaN<real>(); }
275 #endif // GEOGRAPHICLIB_GEOCENTRIC_HPP
void Forward(real lat, real lon, real h, real &X, real &Y, real &Z, std::vector< real > &M) const
#define GEOGRAPHICLIB_EXPORT
GeographicLib::Math::real real
The normal gravity of the earth.
void Forward(real lat, real lon, real h, real &X, real &Y, real &Z) const
Model of the earth's magnetic field.
Geomagnetic field on a circle of latitude.
static const Geocentric WGS84
Math::real Flattening() const
Spherical harmonic series with two corrections to the coefficients.
Math::real MajorRadius() const
Local cartesian coordinates.
Model of the earth's gravity field.
void Reverse(real X, real Y, real Z, real &lat, real &lon, real &h) const
void Reverse(real X, real Y, real Z, real &lat, real &lon, real &h, std::vector< real > &M) const
Header for GeographicLib::Constants class.
Spherical harmonic series with a correction to the coefficients.
Spherical harmonic series.
Gravity on a circle of latitude.