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 
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 
105  const {
106  IntForward(lat, lon, h, x, y, z, NULL);
107  }
108 
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 
160  const {
161  IntReverse(x, y, z, lat, lon, h, NULL);
162  }
163 
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
GeographicLib::Geocentric::MajorRadius
Math::real MajorRadius() const
Definition: Geocentric.hpp:247
GeographicLib::LocalCartesian::MajorRadius
Math::real MajorRadius() const
Definition: LocalCartesian.hpp:223
GeographicLib
Namespace for GeographicLib.
Definition: JacobiConformal.hpp:15
example::h0
const double h0
Definition: testGPSFactor.cpp:41
GeographicLib::LocalCartesian::Forward
void Forward(real lat, real lon, real h, real &x, real &y, real &z) const
Definition: LocalCartesian.hpp:104
GeographicLib::LocalCartesian::_lon0
real _lon0
Definition: LocalCartesian.hpp:44
x
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
Definition: gnuplot_common_settings.hh:12
real
float real
Definition: datatypes.h:10
GEOGRAPHICLIB_EXPORT
#define GEOGRAPHICLIB_EXPORT
Definition: Constants.hpp:91
h
const double h
Definition: testSimpleHelicopter.cpp:19
GeographicLib::LocalCartesian::LocalCartesian
LocalCartesian(const Geocentric &earth=Geocentric::WGS84())
Definition: LocalCartesian.hpp:77
GeographicLib::Geocentric
Geocentric coordinates
Definition: Geocentric.hpp:67
GeographicLib::LocalCartesian::LongitudeOrigin
Math::real LongitudeOrigin() const
Definition: LocalCartesian.hpp:211
GeographicLib::Math::real
double real
Definition: Math.hpp:129
GeographicLib::LocalCartesian::Flattening
Math::real Flattening() const
Definition: LocalCartesian.hpp:229
Geocentric.hpp
Header for GeographicLib::Geocentric class.
example::lat0
const double lat0
Definition: testGPSFactor.cpp:41
example::lon0
const double lon0
Definition: testGPSFactor.cpp:41
GeographicLib::LocalCartesian::Reverse
void Reverse(real x, real y, real z, real &lat, real &lon, real &h) const
Definition: LocalCartesian.hpp:159
GeographicLib::LocalCartesian::LatitudeOrigin
Math::real LatitudeOrigin() const
Definition: LocalCartesian.hpp:206
GeographicLib::LocalCartesian::LocalCartesian
LocalCartesian(real lat0, real lon0, real h0=0, const Geocentric &earth=Geocentric::WGS84())
Definition: LocalCartesian.hpp:64
pybind_wrapper_test_script.z
z
Definition: pybind_wrapper_test_script.py:61
Constants.hpp
Header for GeographicLib::Constants class.
GeographicLib::LocalCartesian::Reverse
void Reverse(real x, real y, real z, real &lat, real &lon, real &h, std::vector< real > &M) const
Definition: LocalCartesian.hpp:189
y
Scalar * y
Definition: level1_cplx_impl.h:124
GeographicLib::LocalCartesian::_earth
Geocentric _earth
Definition: LocalCartesian.hpp:43
GeographicLib::Geocentric::Flattening
Math::real Flattening() const
Definition: Geocentric.hpp:254
GeographicLib::LocalCartesian::HeightOrigin
Math::real HeightOrigin() const
Definition: LocalCartesian.hpp:216
GeographicLib::LocalCartesian
Local cartesian coordinates.
Definition: LocalCartesian.hpp:38
GeographicLib::LocalCartesian::real
Math::real real
Definition: LocalCartesian.hpp:40
GeographicLib::LocalCartesian::_z0
real _z0
Definition: LocalCartesian.hpp:45
GeographicLib::LocalCartesian::Forward
void Forward(real lat, real lon, real h, real &x, real &y, real &z, std::vector< real > &M) const
Definition: LocalCartesian.hpp:135
lon
static const double lon
Definition: testGeographicLib.cpp:34
NULL
#define NULL
Definition: ccolamd.c:609
align_3::t
Point2 t(10, 10)
GeographicLib::Geocentric::WGS84
static const Geocentric & WGS84()
Definition: src/Geocentric.cpp:31
real
Definition: main.h:100
lat
static const double lat
Definition: testGeographicLib.cpp:34
M
Matrix< RealScalar, Dynamic, Dynamic > M
Definition: bench_gemm.cpp:51


gtsam
Author(s):
autogenerated on Sun Dec 22 2024 04:11:56