10 #if !defined(GEOGRAPHICLIB_GEOCENTRIC_HPP)
11 #define GEOGRAPHICLIB_GEOCENTRIC_HPP 1
16 namespace GeographicLib {
76 static const size_t dim_ = 3;
77 static const size_t dim2_ = dim_ * dim_;
78 real _a, _f, _e2, _e2m, _e2a, _e4a, _maxrad;
79 static void Rotation(real sphi, real cphi, real slam, real clam,
81 static void Rotate(real M[dim2_], real x, real y, real z,
82 real& X, real& Y, real& Z) {
85 X = M[0] * x + M[1] * y + M[2] * z;
86 Y = M[3] * x + M[4] * y + M[5] * z;
87 Z = M[6] * x + M[7] * y + M[8] * z;
93 x = M[0] * X + M[3] * Y + M[6] * Z;
94 y = M[1] * X + M[4] * Y + M[7] * Z;
95 z = M[2] * X + M[5] * Y + M[8] * Z;
100 real M[dim2_])
const;
134 void Forward(real lat, real lon, real h, real& X, real& Y, real& Z)
137 IntForward(lat, lon, h, X, Y, Z, NULL);
163 void Forward(real lat, real lon, real h, real& X, real& Y, real& Z,
164 std::vector<real>& M)
168 if (M.end() == M.begin() + dim2_) {
170 IntForward(lat, lon, h, X, Y, Z, t);
171 std::copy(t, t + dim2_, M.begin());
173 IntForward(lat, lon, h, X, Y, Z, NULL);
196 void Reverse(real X, real Y, real Z, real& lat, real& lon, real& h)
199 IntReverse(X, Y, Z, lat, lon, h, NULL);
225 void Reverse(real X, real Y, real Z, real& lat, real& lon, real& h,
226 std::vector<real>& M)
230 if (M.end() == M.begin() + dim2_) {
232 IntReverse(X, Y, Z, lat, lon, h, t);
233 std::copy(t, t + dim2_, M.begin());
235 IntReverse(X, Y, Z, lat, lon, h, NULL);
244 bool Init()
const {
return _a > 0; }
273 static const Geocentric& WGS84();
278 #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.
Math::real Flattening() const
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.
Gravity on a circle of latitude.