10 #if !defined(GEOGRAPHICLIB_LOCALCARTESIAN_HPP)
11 #define GEOGRAPHICLIB_LOCALCARTESIAN_HPP 1
16 namespace GeographicLib {
41 static const size_t dim_ = 3;
42 static const size_t dim2_ = dim_ * dim_;
44 real _lat0, _lon0, _h0;
45 real _x0, _y0, _z0, _r[dim2_];
46 void IntForward(real lat, real lon, real h, real& x, real& y, real& z,
48 void IntReverse(real x, real y, real z, real& lat, real& lon, real& h,
50 void MatrixMultiply(real M[dim2_])
const;
68 { Reset(lat0, lon0, h0); }
107 void Forward(real lat, real lon, real h, real& x, real& y, real& z)
109 IntForward(lat, lon, h, x, y, z, NULL);
139 void Forward(real lat, real lon, real h, real& x, real& y, real& z,
140 std::vector<real>& M)
142 if (M.end() == M.begin() + dim2_) {
144 IntForward(lat, lon, h, x, y, z, t);
145 std::copy(t, t + dim2_, M.begin());
147 IntForward(lat, lon, h, x, y, z, NULL);
163 void Reverse(real x, real y, real z, real& lat, real& lon, real& h)
165 IntReverse(x, y, z, lat, lon, h, NULL);
193 void Reverse(real x, real y, real z, real& lat, real& lon, real& h,
194 std::vector<real>& M)
196 if (M.end() == M.begin() + dim2_) {
198 IntReverse(x, y, z, lat, lon, h, t);
199 std::copy(t, t + dim2_, M.begin());
201 IntReverse(x, y, z, lat, lon, h, NULL);
242 {
return _earth.InverseFlattening(); }
248 #endif // GEOGRAPHICLIB_LOCALCARTESIAN_HPP