10 #if !defined(GEOGRAPHICLIB_LOCALCARTESIAN_HPP)
11 #define GEOGRAPHICLIB_LOCALCARTESIAN_HPP 1
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;
67 { Reset(lat0, lon0, h0); }
104 void Forward(real lat, real lon, real h, real& x, real& y, real& z)
106 IntForward(lat, lon, h, x, y, z, NULL);
135 void Forward(real lat, real lon, real h, real& x, real& y, real& z,
136 std::vector<real>& M)
138 if (M.end() == M.begin() + dim2_) {
140 IntForward(lat, lon, h, x, y, z, t);
141 std::copy(t, t + dim2_, M.begin());
143 IntForward(lat, lon, h, x, y, z, NULL);
161 void Reverse(real x, real y, real z, real& lat, real& lon, real& h)
163 IntReverse(x, y, z, lat, lon, h, NULL);
191 void Reverse(real x, real y, real z, real& lat, real& lon, real& h,
192 std::vector<real>& M)
194 if (M.end() == M.begin() + dim2_) {
196 IntReverse(x, y, z, lat, lon, h, t);
197 std::copy(t, t + dim2_, M.begin());
199 IntReverse(x, y, z, lat, lon, h, NULL);
244 #endif // GEOGRAPHICLIB_LOCALCARTESIAN_HPP