gtsam
3rdparty
GeographicLib
examples
examples/example-NormalGravity.cpp
Go to the documentation of this file.
1
// Example of using the GeographicLib::NormalGravity class
2
3
#include <iostream>
4
#include <exception>
5
#include <
GeographicLib/NormalGravity.hpp
>
6
#include <
GeographicLib/Constants.hpp
>
7
8
using namespace
std
;
9
using namespace
GeographicLib
;
10
11
int
main
() {
12
try
{
13
NormalGravity
grav(Constants::WGS84_a(), Constants::WGS84_GM(),
14
Constants::WGS84_omega(), Constants::WGS84_f());
15
// Alternatively: const NormalGravity& grav = NormalGravity::WGS84();
16
double
lat
= 27.99,
h
= 8820;
// Mt Everest
17
double
gammay, gammaz;
18
grav.
Gravity
(
lat
,
h
, gammay, gammaz);
19
cout << gammay <<
" "
<< gammaz <<
"\n"
;
20
}
21
catch
(
const
exception&
e
) {
22
cerr <<
"Caught exception: "
<<
e
.what() <<
"\n"
;
23
return
1;
24
}
25
}
main
int main()
Definition:
examples/example-NormalGravity.cpp:11
e
Array< double, 1, 3 > e(1./3., 0.5, 2.)
GeographicLib
Namespace for GeographicLib.
Definition:
JacobiConformal.hpp:15
h
const double h
Definition:
testSimpleHelicopter.cpp:19
GeographicLib::NormalGravity
The normal gravity of the earth.
Definition:
NormalGravity.hpp:79
Constants.hpp
Header for GeographicLib::Constants class.
std
Definition:
BFloat16.h:88
NormalGravity.hpp
Header for GeographicLib::NormalGravity class.
GeographicLib::NormalGravity::Gravity
Math::real Gravity(real lat, real h, real &gammay, real &gammaz) const
Definition:
src/NormalGravity.cpp:255
lat
static const double lat
Definition:
testGeographicLib.cpp:34
gtsam
Author(s):
autogenerated on Sat Nov 16 2024 04:02:16