10#if !defined(GEOGRAPHICLIB_GEOCENTRIC_HPP)
11#define GEOGRAPHICLIB_GEOCENTRIC_HPP 1
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(
const 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;
132 void Forward(real lat, real lon, real h, real& X, real& Y, real& Z)
135 IntForward(lat, lon, h, X, Y, Z, NULL);
161 void Forward(real lat, real lon, real h, real& X, real& Y, real& Z,
162 std::vector<real>& M)
166 if (M.end() == M.begin() + dim2_) {
168 IntForward(lat, lon, h, X, Y, Z, t);
169 std::copy(t, t + dim2_, M.begin());
171 IntForward(lat, lon, h, X, Y, Z, NULL);
195 void Reverse(real X, real Y, real Z, real& lat, real& lon, real& h)
198 IntReverse(X, Y, Z, lat, lon, h, NULL);
224 void Reverse(real X, real Y, real Z, real& lat, real& lon, real& h,
225 std::vector<real>& M)
229 if (M.end() == M.begin() + dim2_) {
231 IntReverse(X, Y, Z, lat, lon, h, t);
232 std::copy(t, t + dim2_, M.begin());
234 IntReverse(X, Y, Z, lat, lon, h, NULL);
243 bool Init()
const {
return _a > 0; }
Header for GeographicLib::Constants class.
#define GEOGRAPHICLIB_EXPORT
GeographicLib::Math::real real
void Reverse(real X, real Y, real Z, real &lat, real &lon, real &h) const
void Forward(real lat, real lon, real h, real &X, real &Y, real &Z) const
Math::real Flattening() const
void Reverse(real X, real Y, real Z, real &lat, real &lon, real &h, std::vector< real > &M) const
void Forward(real lat, real lon, real h, real &X, real &Y, real &Z, std::vector< real > &M) const
Math::real EquatorialRadius() const
Gravity on a circle of latitude.
Model of the earth's gravity field.
Local cartesian coordinates.
Geomagnetic field on a circle of latitude.
Model of the earth's magnetic field.
The normal gravity of the earth.
Namespace for GeographicLib.