gtsam
3rdparty
GeographicLib
examples
JacobiConformal.cpp
Go to the documentation of this file.
1
// Example of using the GeographicLib::JacobiConformal class.
2
3
#include <iostream>
4
#include <iomanip>
5
#include <exception>
6
#include <
GeographicLib/Utility.hpp
>
7
#include "
JacobiConformal.hpp
"
8
9
using namespace
std
;
10
using namespace
GeographicLib
;
11
12
int
main
() {
13
try
{
14
Utility::set_digits();
15
// These parameters were derived from the EGM2008 geoid; see 2011-07-04
16
// E-mail to PROJ.4 list, "Analyzing the bumps in the EGM2008 geoid". The
17
// longitude of the major axis is -15. These are close to the values given
18
// by Milan Bursa, Vladimira Fialova, "Parameters of the Earth's tri-axial
19
// level ellipsoid", Studia Geophysica et Geodaetica 37(1), 1-13 (1993):
20
//
21
// longitude of major axis = -14.93 +/- 0.05
22
// a = 6378171.36 +/- 0.30
23
// a/(a-c) = 297.7738 +/- 0.0003
24
// a/(a-b) = 91449 +/- 60
25
// which gives: a = 6378171.36, b = 6378101.61, c = 6356751.84
26
Math::real
a
= 6378137+35,
b
= 6378137-35,
c
= 6356752;
27
JacobiConformal
jc(a,
b
,
c
, a-
b
,
b
-
c
);
28
cout << fixed << setprecision(1)
29
<<
"Ellipsoid parameters: a = "
30
<< a <<
", b = "
<<
b
<<
", c = "
<<
c
<<
"\n"
31
<< setprecision(10)
32
<<
"Quadrants: x = "
<< jc.
x
() <<
", y = "
<< jc.
y
() <<
"\n"
;
33
cout <<
"Coordinates (angle x y) in degrees:\n"
;
34
for
(
int
i
= 0;
i
<= 90;
i
+= 5) {
35
Math::real
omg =
i
, bet =
i
;
36
cout <<
i
<<
" "
<< jc.
x
(omg) <<
" "
<< jc.
y
(bet) <<
"\n"
;
37
}
38
}
39
catch
(
const
exception&
e
) {
40
cerr <<
"Caught exception: "
<< e.what() <<
"\n"
;
41
return
1;
42
}
43
}
GeographicLib::Math::real
double real
Definition:
Math.hpp:129
b
Scalar * b
Definition:
benchVecAdd.cpp:17
Utility.hpp
Header for GeographicLib::Utility class.
c
Scalar Scalar * c
Definition:
benchVecAdd.cpp:17
std
Definition:
BFloat16.h:88
GeographicLib::JacobiConformal::x
Math::real x() const
Definition:
JacobiConformal.hpp:110
GeographicLib::JacobiConformal::y
Math::real y() const
Definition:
JacobiConformal.hpp:139
GeographicLib
Namespace for GeographicLib.
Definition:
JacobiConformal.hpp:15
e
Array< double, 1, 3 > e(1./3., 0.5, 2.)
GeographicLib::JacobiConformal
Jacobi's conformal projection of a triaxial ellipsoid.
Definition:
JacobiConformal.hpp:41
main
int main()
Definition:
JacobiConformal.cpp:12
JacobiConformal.hpp
Header for GeographicLib::JacobiConformal class.
a
ArrayXXi a
Definition:
Array_initializer_list_23_cxx11.cpp:1
i
int i
Definition:
BiCGSTAB_step_by_step.cpp:9
gtsam
Author(s):
autogenerated on Tue Jul 4 2023 02:34:27