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(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;
90 real&
x, real&
y, real&
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;
97 void IntForward(real
lat, real
lon, real
h, real&
X, real&
Y, real&
Z,
99 void IntReverse(real X, real Y, real Z, real& lat, real& lon, real& h,
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);
194 void Reverse(real X, real Y, real Z, real& lat, real& lon, real& h)
197 IntReverse(X, Y, Z, lat, lon, h,
NULL);
223 void Reverse(real X, real Y, real Z, real& lat, real& lon, real& h,
224 std::vector<real>&
M)
228 if (M.end() == M.begin() + dim2_) {
230 IntReverse(X, Y, Z, lat, lon, h, t);
231 std::copy(t, t + dim2_, M.begin());
233 IntReverse(X, Y, Z, lat, lon, h,
NULL);
242 bool Init()
const {
return _a > 0; }
267 #endif // GEOGRAPHICLIB_GEOCENTRIC_HPP static void Rotate(real M[dim2_], real x, real y, real z, real &X, real &Y, real &Z)
Matrix< RealScalar, Dynamic, Dynamic > M
#define GEOGRAPHICLIB_EXPORT
The normal gravity of the earth.
Model of the earth's magnetic field.
Geomagnetic field on a circle of latitude.
void Forward(real lat, real lon, real h, real &X, real &Y, real &Z) const
Point2(* f)(const Point3 &, OptionalJacobian< 2, 3 >)
Namespace for GeographicLib.
Math::real Flattening() const
void Reverse(real X, real Y, real Z, real &lat, real &lon, real &h, std::vector< real > &M) const
Local cartesian coordinates.
Model of the earth's gravity field.
static void Unrotate(real M[dim2_], real X, real Y, real Z, real &x, real &y, real &z)
Header for GeographicLib::Constants class.
Math::real MajorRadius() const
void Forward(real lat, real lon, real h, real &X, real &Y, real &Z, std::vector< real > &M) const
void Reverse(real X, real Y, real Z, real &lat, real &lon, real &h) const
set noclip points set clip one set noclip two set bar set border lt lw set xdata set ydata set zdata set x2data set y2data set boxwidth set dummy x
Gravity on a circle of latitude.