examples/example-MagneticModel.cpp
Go to the documentation of this file.
1 // Example of using the GeographicLib::MagneticModel class
2 
3 #include <iostream>
4 #include <exception>
6 
7 using namespace std;
8 using namespace GeographicLib;
9 
10 int main() {
11  try {
12  MagneticModel mag("wmm2010");
13  double lat = 27.99, lon = 86.93, h = 8820, t = 2012; // Mt Everest
14  double Bx, By, Bz;
15  mag(t, lat,lon, h, Bx, By, Bz);
16  double H, F, D, I;
17  MagneticModel::FieldComponents(Bx, By, Bz, H, F, D, I);
18  cout << H << " " << F << " " << D << " " << I << "\n";
19  }
20  catch (const exception& e) {
21  cerr << "Caught exception: " << e.what() << "\n";
22  return 1;
23  }
24 }
H
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 y set format x g set format y g set format x2 g set format y2 g set format z g set angles radians set nogrid set key title set key left top Right noreverse box linetype linewidth samplen spacing width set nolabel set noarrow set nologscale set logscale x set set pointsize set encoding default set nopolar set noparametric set set set set surface set nocontour set clabel set mapping cartesian set nohidden3d set cntrparam order set cntrparam linear set cntrparam levels auto set cntrparam points set size set set xzeroaxis lt lw set x2zeroaxis lt lw set yzeroaxis lt lw set y2zeroaxis lt lw set tics in set ticslevel set tics set mxtics default set mytics default set mx2tics default set my2tics default set xtics border mirror norotate autofreq set ytics border mirror norotate autofreq set ztics border nomirror norotate autofreq set nox2tics set noy2tics set timestamp bottom norotate set rrange[*:*] noreverse nowriteback set trange[*:*] noreverse nowriteback set urange[*:*] noreverse nowriteback set vrange[*:*] noreverse nowriteback set xlabel matrix size set x2label set timefmt d m y n H
Definition: gnuplot_common_settings.hh:74
MagneticModel.hpp
Header for GeographicLib::MagneticModel class.
D
MatrixXcd D
Definition: EigenSolver_EigenSolver_MatrixType.cpp:14
e
Array< double, 1, 3 > e(1./3., 0.5, 2.)
GeographicLib
Namespace for GeographicLib.
Definition: JacobiConformal.hpp:15
GeographicLib::MagneticModel
Model of the earth's magnetic field.
Definition: MagneticModel.hpp:69
main
int main()
Definition: examples/example-MagneticModel.cpp:10
h
const double h
Definition: testSimpleHelicopter.cpp:19
I
#define I
Definition: main.h:112
gtsam::symbol_shorthand::F
Key F(std::uint64_t j)
Definition: inference/Symbol.h:153
std
Definition: BFloat16.h:88
lon
static const double lon
Definition: testGeographicLib.cpp:34
align_3::t
Point2 t(10, 10)
lat
static const double lat
Definition: testGeographicLib.cpp:34


gtsam
Author(s):
autogenerated on Sat Nov 16 2024 04:02:16