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 }
static const double lat
Definition: Half.h:150
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
Model of the earth&#39;s magnetic field.
Signature::Row F
Definition: Signature.cpp:53
Namespace for GeographicLib.
Array< double, 1, 3 > e(1./3., 0.5, 2.)
Header for GeographicLib::MagneticModel class.
static const Matrix I
Definition: lago.cpp:35
const double h
static const double lon
Point2 t(10, 10)


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