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 
45  MagneticCircle(real a, real f, real lat, real h, real t,
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 
64  MagneticCircle(real a, real f, real lat, real h, real t,
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
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)
static T NaN()
Definition: Math.hpp:830
#define GEOGRAPHICLIB_EXPORT
Definition: Constants.hpp:91
static const double lat
void operator()(real lon, real &Bx, real &By, real &Bz) const
Mathematical functions needed by GeographicLib.
Definition: Math.hpp:102
Model of the earth&#39;s magnetic field.
Geomagnetic field on a circle of latitude.
Math::real MajorRadius() const
Array33i a
T interpolate(const T &X, const T &Y, double t)
Definition: Lie.h:325
Point2(* f)(const Point3 &, OptionalJacobian< 2, 3 >)
Namespace for GeographicLib.
Header for GeographicLib::CircularEngine class.
Spherical harmonic sums for a circle.
const double h
void operator()(real lon, real &Bx, real &By, real &Bz, real &Bxt, real &Byt, real &Bzt) const
Header for GeographicLib::Constants class.
static const double lon
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)
Math::real Flattening() const
Point2 t(10, 10)


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