LocalCartesian.hpp
Go to the documentation of this file.
1 
10 #if !defined(GEOGRAPHICLIB_LOCALCARTESIAN_HPP)
11 #define GEOGRAPHICLIB_LOCALCARTESIAN_HPP 1
12 
15 
16 namespace GeographicLib {
17 
39  private:
40  typedef Math::real real;
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,
47  real M[dim2_]) const;
48  void IntReverse(real x, real y, real z, real& lat, real& lon, real& h,
49  real M[dim2_]) const;
50  void MatrixMultiply(real M[dim2_]) const;
51  public:
52 
64  LocalCartesian(real lat0, real lon0, real h0 = 0,
65  const Geocentric& earth = Geocentric::WGS84())
66  : _earth(earth)
67  { Reset(lat0, lon0, h0); }
68 
77  explicit LocalCartesian(const Geocentric& earth = Geocentric::WGS84())
78  : _earth(earth)
79  { Reset(real(0), real(0), real(0)); }
80 
90  void Reset(real lat0, real lon0, real h0 = 0);
91 
104  void Forward(real lat, real lon, real h, real& x, real& y, real& z)
105  const {
106  IntForward(lat, lon, h, x, y, z, NULL);
107  }
108 
135  void Forward(real lat, real lon, real h, real& x, real& y, real& z,
136  std::vector<real>& M)
137  const {
138  if (M.end() == M.begin() + dim2_) {
139  real t[dim2_];
140  IntForward(lat, lon, h, x, y, z, t);
141  std::copy(t, t + dim2_, M.begin());
142  } else
143  IntForward(lat, lon, h, x, y, z, NULL);
144  }
145 
159  void Reverse(real x, real y, real z, real& lat, real& lon, real& h)
160  const {
161  IntReverse(x, y, z, lat, lon, h, NULL);
162  }
163 
189  void Reverse(real x, real y, real z, real& lat, real& lon, real& h,
190  std::vector<real>& M)
191  const {
192  if (M.end() == M.begin() + dim2_) {
193  real t[dim2_];
194  IntReverse(x, y, z, lat, lon, h, t);
195  std::copy(t, t + dim2_, M.begin());
196  } else
197  IntReverse(x, y, z, lat, lon, h, NULL);
198  }
199 
202 
206  Math::real LatitudeOrigin() const { return _lat0; }
207 
211  Math::real LongitudeOrigin() const { return _lon0; }
212 
216  Math::real HeightOrigin() const { return _h0; }
217 
223  Math::real MajorRadius() const { return _earth.MajorRadius(); }
224 
229  Math::real Flattening() const { return _earth.Flattening(); }
231 
232  };
233 
234 } // namespace GeographicLib
235 
236 #endif // GEOGRAPHICLIB_LOCALCARTESIAN_HPP
LocalCartesian(real lat0, real lon0, real h0=0, const Geocentric &earth=Geocentric::WGS84())
Matrix< RealScalar, Dynamic, Dynamic > M
Definition: bench_gemm.cpp:38
#define GEOGRAPHICLIB_EXPORT
Definition: Constants.hpp:91
float real
Definition: datatypes.h:10
Scalar * y
static const double lat
const double h0
Math::real Flattening() const
Geocentric coordinates
Definition: Geocentric.hpp:67
void Reverse(real x, real y, real z, real &lat, real &lon, real &h) const
const double lat0
static const Geocentric & WGS84()
Math::real LongitudeOrigin() const
Namespace for GeographicLib.
Math::real Flattening() const
Definition: Geocentric.hpp:254
const double lon0
LocalCartesian(const Geocentric &earth=Geocentric::WGS84())
Math::real MajorRadius() const
#define NULL
Definition: ccolamd.c:609
Math::real MajorRadius() const
Definition: Geocentric.hpp:247
Header for GeographicLib::Geocentric class.
Math::real HeightOrigin() const
Local cartesian coordinates.
const double h
void Forward(real lat, real lon, real h, real &x, real &y, real &z, std::vector< real > &M) const
Header for GeographicLib::Constants class.
void Forward(real lat, real lon, real h, real &x, real &y, real &z) const
static const double lon
Math::real LatitudeOrigin() 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
Point2 t(10, 10)
void Reverse(real x, real y, real z, real &lat, real &lon, real &h, std::vector< real > &M) const


gtsam
Author(s):
autogenerated on Sat May 8 2021 02:42:32