10 #if !defined(GEOGRAPHICLIB_GEOCENTRIC_HPP)
11 #define GEOGRAPHICLIB_GEOCENTRIC_HPP 1
79 static const size_t dim_ = 3;
80 static const size_t dim2_ = dim_ * dim_;
81 real _a, _f, _e2, _e2m, _e2a, _e4a, _maxrad;
82 static void Rotation(real sphi, real cphi, real slam, real clam,
84 static void Rotate(real M[dim2_], real x, real y, real z,
85 real& X, real& Y, real& Z) {
88 X = M[0] * x + M[1] * y + M[2] * z;
89 Y = M[3] * x + M[4] * y + M[5] * z;
90 Z = M[6] * x + M[7] * y + M[8] * z;
92 static void Unrotate(real M[dim2_], real X, real Y, real Z,
93 real& x, real& y, real& z) {
96 x = M[0] * X + M[3] * Y + M[6] * Z;
97 y = M[1] * X + M[4] * Y + M[7] * Z;
98 z = M[2] * X + M[5] * Y + M[8] * Z;
100 void IntForward(real lat, real lon, real h, real& X, real& Y, real& Z,
101 real M[dim2_])
const;
102 void IntReverse(real X, real Y, real Z, real& lat, real& lon, real& h,
103 real M[dim2_])
const;
117 Geocentric(real a, real f);
137 void Forward(real lat, real lon, real h, real& X, real& Y, real& Z)
140 IntForward(lat, lon, h, X, Y, Z, NULL);
166 void Forward(real lat, real lon, real h, real& X, real& Y, real& Z,
167 std::vector<real>& M)
171 if (M.end() == M.begin() + dim2_) {
173 IntForward(lat, lon, h, X, Y, Z, t);
174 std::copy(t, t + dim2_, M.begin());
176 IntForward(lat, lon, h, X, Y, Z, NULL);
199 void Reverse(real X, real Y, real Z, real& lat, real& lon, real& h)
202 IntReverse(X, Y, Z, lat, lon, h, NULL);
228 void Reverse(real X, real Y, real Z, real& lat, real& lon, real& h,
229 std::vector<real>& M)
233 if (M.end() == M.begin() + dim2_) {
235 IntReverse(X, Y, Z, lat, lon, h, t);
236 std::copy(t, t + dim2_, M.begin());
238 IntReverse(X, Y, Z, lat, lon, h, NULL);
247 bool Init()
const {
return _a > 0; }
276 static const Geocentric& WGS84();
281 #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.
Namespace for GeographicLib.
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.