MagneticCircle.hpp
Go to the documentation of this file.
1 
10 #if !defined(GEOGRAPHICLIB_MAGNETICCIRCLE_HPP)
11 #define GEOGRAPHICLIB_MAGNETICCIRCLE_HPP 1
12 
13 #include <vector>
16 
17 namespace GeographicLib {
18 
38  private:
39  typedef Math::real real;
40 
41  real _a, _f, _lat, _h, _t, _cphi, _sphi, _t1, _dt0;
42  bool _interpolate, _constterm;
43  CircularEngine _circ0, _circ1, _circ2;
44 
46  real cphi, real sphi, real t1, real dt0,
47  bool interpolate,
48  const CircularEngine& circ0, const CircularEngine& circ1)
49  : _a(a)
50  , _f(f)
51  , _lat(Math::LatFix(lat))
52  , _h(h)
53  , _t(t)
54  , _cphi(cphi)
55  , _sphi(sphi)
56  , _t1(t1)
57  , _dt0(dt0)
58  , _interpolate(interpolate)
59  , _constterm(false)
60  , _circ0(circ0)
61  , _circ1(circ1)
62  {}
63 
65  real cphi, real sphi, real t1, real dt0,
66  bool interpolate,
67  const CircularEngine& circ0, const CircularEngine& circ1,
68  const CircularEngine& circ2)
69  : _a(a)
70  , _f(f)
71  , _lat(lat)
72  , _h(h)
73  , _t(t)
74  , _cphi(cphi)
75  , _sphi(sphi)
76  , _t1(t1)
77  , _dt0(dt0)
78  , _interpolate(interpolate)
79  , _constterm(true)
80  , _circ0(circ0)
81  , _circ1(circ1)
82  , _circ2(circ2)
83  {}
84 
85  void Field(real lon, bool diffp,
86  real& Bx, real& By, real& Bz,
87  real& Bxt, real& Byt, real& Bzt) const;
88 
89  friend class MagneticModel; // MagneticModel calls the private constructor
90 
91  public:
92 
98  MagneticCircle() : _a(-1) {}
99 
102 
114  void operator()(real lon, real& Bx, real& By, real& Bz) const {
115  real dummy;
116  Field(lon, false, Bx, By, Bz, dummy, dummy, dummy);
117  }
118 
133  void operator()(real lon, real& Bx, real& By, real& Bz,
134  real& Bxt, real& Byt, real& Bzt) const {
135  Field(lon, true, Bx, By, Bz, Bxt, Byt, Bzt);
136  }
138 
141 
145  bool Init() const { return _a > 0; }
152  { return Init() ? _a : Math::NaN(); }
158  { return Init() ? _f : Math::NaN(); }
163  { return Init() ? _lat : Math::NaN(); }
168  { return Init() ? _h : Math::NaN(); }
172  Math::real Time() const
173  { return Init() ? _t : Math::NaN(); }
174 
176  };
177 
178 } // namespace GeographicLib
179 
180 #endif // GEOGRAPHICLIB_MAGNETICCIRCLE_HPP
GeographicLib::MagneticCircle::Init
bool Init() const
Definition: MagneticCircle.hpp:145
GeographicLib::Math::NaN
static T NaN()
Definition: Math.hpp:830
GeographicLib::MagneticCircle::Height
Math::real Height() const
Definition: MagneticCircle.hpp:167
GeographicLib::MagneticCircle::_circ2
CircularEngine _circ2
Definition: MagneticCircle.hpp:43
GeographicLib
Namespace for GeographicLib.
Definition: JacobiConformal.hpp:15
GeographicLib::MagneticCircle::MagneticCircle
MagneticCircle(real a, real f, real lat, real h, real t, real cphi, real sphi, real t1, real dt0, bool interpolate, const CircularEngine &circ0, const CircularEngine &circ1, const CircularEngine &circ2)
Definition: MagneticCircle.hpp:64
GeographicLib::MagneticModel
Model of the earth's magnetic field.
Definition: MagneticModel.hpp:69
CircularEngine.hpp
Header for GeographicLib::CircularEngine class.
GEOGRAPHICLIB_EXPORT
#define GEOGRAPHICLIB_EXPORT
Definition: Constants.hpp:91
h
const double h
Definition: testSimpleHelicopter.cpp:19
GeographicLib::MagneticCircle::_t1
real _t1
Definition: MagneticCircle.hpp:41
pybind_wrapper_test_script.dummy
dummy
Definition: pybind_wrapper_test_script.py:42
GeographicLib::Math::real
double real
Definition: Math.hpp:129
GeographicLib::Math
Mathematical functions needed by GeographicLib.
Definition: Math.hpp:102
GeographicLib::CircularEngine
Spherical harmonic sums for a circle.
Definition: CircularEngine.hpp:52
gtsam::interpolate
T interpolate(const T &X, const T &Y, double t, typename MakeOptionalJacobian< T, T >::type Hx={}, typename MakeOptionalJacobian< T, T >::type Hy={})
Definition: Lie.h:327
GeographicLib::MagneticCircle::operator()
void operator()(real lon, real &Bx, real &By, real &Bz) const
Definition: MagneticCircle.hpp:114
Constants.hpp
Header for GeographicLib::Constants class.
tree::f
Point2(* f)(const Point3 &, OptionalJacobian< 2, 3 >)
Definition: testExpression.cpp:218
a
ArrayXXi a
Definition: Array_initializer_list_23_cxx11.cpp:1
GeographicLib::MagneticCircle::real
Math::real real
Definition: MagneticCircle.hpp:39
GeographicLib::MagneticCircle::Flattening
Math::real Flattening() const
Definition: MagneticCircle.hpp:157
GeographicLib::MagneticCircle::MagneticCircle
MagneticCircle(real a, real f, real lat, real h, real t, real cphi, real sphi, real t1, real dt0, bool interpolate, const CircularEngine &circ0, const CircularEngine &circ1)
Definition: MagneticCircle.hpp:45
GeographicLib::MagneticCircle::operator()
void operator()(real lon, real &Bx, real &By, real &Bz, real &Bxt, real &Byt, real &Bzt) const
Definition: MagneticCircle.hpp:133
lon
static const double lon
Definition: testGeographicLib.cpp:34
GeographicLib::MagneticCircle::MajorRadius
Math::real MajorRadius() const
Definition: MagneticCircle.hpp:151
GeographicLib::MagneticCircle::Latitude
Math::real Latitude() const
Definition: MagneticCircle.hpp:162
align_3::t
Point2 t(10, 10)
real
Definition: main.h:100
GeographicLib::MagneticCircle
Geomagnetic field on a circle of latitude.
Definition: MagneticCircle.hpp:37
lat
static const double lat
Definition: testGeographicLib.cpp:34
GeographicLib::MagneticCircle::_interpolate
bool _interpolate
Definition: MagneticCircle.hpp:42
GeographicLib::MagneticCircle::Time
Math::real Time() const
Definition: MagneticCircle.hpp:172
GeographicLib::MagneticCircle::MagneticCircle
MagneticCircle()
Definition: MagneticCircle.hpp:98


gtsam
Author(s):
autogenerated on Fri Nov 1 2024 03:33:10