src/Ellipsoid.cpp
Go to the documentation of this file.
1 
11 
12 namespace GeographicLib {
13 
14  using namespace std;
15 
17  : stol_(real(0.01) * sqrt(numeric_limits<real>::epsilon()))
18  , _a(a)
19  , _f(f)
20  , _f1(1 - _f)
21  , _f12(Math::sq(_f1))
22  , _e2(_f * (2 - _f))
23  , _es((_f < 0 ? -1 : 1) * sqrt(abs(_e2)))
24  , _e12(_e2 / (1 - _e2))
25  , _n(_f / (2 - _f))
26  , _b(_a * _f1)
27  , _tm(_a, _f, real(1))
28  , _ell(-_e12)
29  , _au(_a, _f, real(0), real(1), real(0), real(1), real(1))
30  {}
31 
33  static const Ellipsoid wgs84(Constants::WGS84_a(), Constants::WGS84_f());
34  return wgs84;
35  }
36 
38  { return _b * _ell.E(); }
39 
41  return 4 * Math::pi() *
42  ((Math::sq(_a) + Math::sq(_b) *
43  (_e2 == 0 ? 1 :
44  (_e2 > 0 ? Math::atanh(sqrt(_e2)) : atan(sqrt(-_e2))) /
45  sqrt(abs(_e2))))/2);
46  }
47 
49  { return Math::atand(_f1 * Math::tand(Math::LatFix(phi))); }
50 
52  { return Math::atand(Math::tand(Math::LatFix(beta)) / _f1); }
53 
55  { return Math::atand(_f12 * Math::tand(Math::LatFix(phi))); }
56 
58  { return Math::atand(Math::tand(Math::LatFix(theta)) / _f12); }
59 
61  return abs(phi) == 90 ? phi:
62  90 * MeridianDistance(phi) / QuarterMeridian();
63  }
64 
66  if (abs(mu) == 90)
67  return mu;
68  return InverseParametricLatitude(_ell.Einv(mu * _ell.E() / 90) /
69  Math::degree());
70  }
71 
73  { return Math::atand(_au.txif(Math::tand(Math::LatFix(phi)))); }
74 
77 
80 
82  { return Math::atand(Math::tauf(Math::tand(Math::LatFix(chi)), _es)); }
83 
86  Math::degree(); }
87 
89  { return Math::atand(Math::tauf(sinh(psi * Math::degree()), _es)); }
90 
92  return abs(phi) == 90 ? 0 :
93  // a * cos(beta)
95  }
96 
98  real tbeta = _f1 * Math::tand(phi);
99  // b * sin(beta)
100  return _b * tbeta / Math::hypot(real(1),
101  _f1 * Math::tand(Math::LatFix(phi)));
102  }
103 
105  { return _b * _ell.Ed( ParametricLatitude(phi) ); }
106 
108  real v = 1 - _e2 * Math::sq(Math::sind(Math::LatFix(phi)));
109  return _a * (1 - _e2) / (v * sqrt(v));
110  }
111 
113  real v = 1 - _e2 * Math::sq(Math::sind(Math::LatFix(phi)));
114  return _a / sqrt(v);
115  }
116 
118  real calp, salp,
119  v = 1 - _e2 * Math::sq(Math::sind(Math::LatFix(phi)));
120  Math::sincosd(azi, salp, calp);
121  return _a / (sqrt(v) * (Math::sq(calp) * v / (1 - _e2) + Math::sq(salp)));
122  }
123 
124 } // namespace GeographicLib
GeographicLib::Ellipsoid::InverseParametricLatitude
Math::real InverseParametricLatitude(real beta) const
Definition: src/Ellipsoid.cpp:51
GeographicLib::Ellipsoid::TransverseCurvatureRadius
Math::real TransverseCurvatureRadius(real phi) const
Definition: src/Ellipsoid.cpp:112
GeographicLib::Math::sind
static T sind(T x)
Definition: Math.hpp:609
GeographicLib::Math::atanh
static T atanh(T x)
Definition: Math.hpp:328
GeographicLib::AlbersEqualArea::txif
real txif(real tphi) const
Definition: src/AlbersEqualArea.cpp:298
GeographicLib::Math::atand
static T atand(T x)
Definition: Math.hpp:723
psi
double psi(double x)
Definition: psi.c:146
GeographicLib::Math::tand
static T tand(T x)
Definition: Math.hpp:671
atan
const EIGEN_DEVICE_FUNC AtanReturnType atan() const
Definition: ArrayCwiseUnaryOps.h:283
screwPose2::xi
Vector xi
Definition: testPose2.cpp:148
GeographicLib
Namespace for GeographicLib.
Definition: JacobiConformal.hpp:15
mu
double mu
Definition: testBoundingConstraint.cpp:37
GeographicLib::Ellipsoid::_f1
real _f1
Definition: Ellipsoid.hpp:44
GeographicLib::Ellipsoid::QuarterMeridian
Math::real QuarterMeridian() const
Definition: src/Ellipsoid.cpp:37
GeographicLib::Math::tauf
static T tauf(T taup, T es)
Definition: Math.cpp:31
GeographicLib::Math::sincosd
static void sincosd(T x, T &sinx, T &cosx)
Definition: Math.hpp:558
GeographicLib::Ellipsoid::_au
AlbersEqualArea _au
Definition: Ellipsoid.hpp:47
GeographicLib::Ellipsoid::IsometricLatitude
Math::real IsometricLatitude(real phi) const
Definition: src/Ellipsoid.cpp:84
beta
double beta(double a, double b)
Definition: beta.c:61
GeographicLib::Ellipsoid::InverseGeocentricLatitude
Math::real InverseGeocentricLatitude(real theta) const
Definition: src/Ellipsoid.cpp:57
GeographicLib::Ellipsoid::_ell
EllipticFunction _ell
Definition: Ellipsoid.hpp:46
GeographicLib::AlbersEqualArea::tphif
real tphif(real txi) const
Definition: src/AlbersEqualArea.cpp:325
GeographicLib::Ellipsoid::MeridianDistance
Math::real MeridianDistance(real phi) const
Definition: src/Ellipsoid.cpp:104
GeographicLib::Ellipsoid::RectifyingLatitude
Math::real RectifyingLatitude(real phi) const
Definition: src/Ellipsoid.cpp:60
epsilon
static double epsilon
Definition: testRot3.cpp:37
GeographicLib::Math::real
double real
Definition: Math.hpp:129
GeographicLib::Ellipsoid::NormalCurvatureRadius
Math::real NormalCurvatureRadius(real phi, real azi) const
Definition: src/Ellipsoid.cpp:117
GeographicLib::Ellipsoid::ConformalLatitude
Math::real ConformalLatitude(real phi) const
Definition: src/Ellipsoid.cpp:78
GeographicLib::Math
Mathematical functions needed by GeographicLib.
Definition: Math.hpp:102
GeographicLib::Math::degree
static T degree()
Definition: Math.hpp:216
GeographicLib::Ellipsoid::InverseRectifyingLatitude
Math::real InverseRectifyingLatitude(real mu) const
Definition: src/Ellipsoid.cpp:65
GeographicLib::Ellipsoid::Ellipsoid
Ellipsoid(real a, real f)
Definition: src/Ellipsoid.cpp:16
GeographicLib::Ellipsoid::GeocentricLatitude
Math::real GeocentricLatitude(real phi) const
Definition: src/Ellipsoid.cpp:54
GeographicLib::Ellipsoid::_es
real _es
Definition: Ellipsoid.hpp:44
GeographicLib::Ellipsoid::_a
real _a
Definition: Ellipsoid.hpp:44
GeographicLib::Ellipsoid::MeridionalCurvatureRadius
Math::real MeridionalCurvatureRadius(real phi) const
Definition: src/Ellipsoid.cpp:107
GeographicLib::Math::asinh
static T asinh(T x)
Definition: Math.hpp:311
GeographicLib::EllipticFunction::Ed
Math::real Ed(real ang) const
Definition: src/EllipticFunction.cpp:506
GeographicLib::Ellipsoid::_e2
real _e2
Definition: Ellipsoid.hpp:44
GeographicLib::Math::LatFix
static T LatFix(T x)
Definition: Math.hpp:467
tree::f
Point2(* f)(const Point3 &, OptionalJacobian< 2, 3 >)
Definition: testExpression.cpp:218
GeographicLib::Ellipsoid::InverseConformalLatitude
Math::real InverseConformalLatitude(real chi) const
Definition: src/Ellipsoid.cpp:81
GeographicLib::Ellipsoid::ParametricLatitude
Math::real ParametricLatitude(real phi) const
Definition: src/Ellipsoid.cpp:48
a
ArrayXXi a
Definition: Array_initializer_list_23_cxx11.cpp:1
Ellipsoid.hpp
Header for GeographicLib::Ellipsoid class.
GeographicLib::Ellipsoid::AuthalicLatitude
Math::real AuthalicLatitude(real phi) const
Definition: src/Ellipsoid.cpp:72
GeographicLib::Math::pi
static T pi()
Definition: Math.hpp:202
GeographicLib::Constants::WGS84_a
static T WGS84_a()
Definition: Constants.hpp:159
GeographicLib::Ellipsoid::InverseIsometricLatitude
Math::real InverseIsometricLatitude(real psi) const
Definition: src/Ellipsoid.cpp:88
std
Definition: BFloat16.h:88
GeographicLib::Ellipsoid::CircleHeight
Math::real CircleHeight(real phi) const
Definition: src/Ellipsoid.cpp:97
GeographicLib::Math::taupf
static T taupf(T tau, T es)
Definition: Math.cpp:25
v
Array< int, Dynamic, 1 > v
Definition: Array_initializer_list_vector_cxx11.cpp:1
GeographicLib::EllipticFunction::Einv
Math::real Einv(real x) const
Definition: src/EllipticFunction.cpp:538
GeographicLib::Ellipsoid::InverseAuthalicLatitude
Math::real InverseAuthalicLatitude(real xi) const
Definition: src/Ellipsoid.cpp:75
GeographicLib::Constants::WGS84_f
static T WGS84_f()
Definition: Constants.hpp:169
abs
#define abs(x)
Definition: datatypes.h:17
GeographicLib::Ellipsoid::real
Math::real real
Definition: Ellipsoid.hpp:41
GeographicLib::Ellipsoid::_b
real _b
Definition: Ellipsoid.hpp:44
sinh
const EIGEN_DEVICE_FUNC SinhReturnType sinh() const
Definition: ArrayCwiseUnaryOps.h:339
GeographicLib::Math::sq
static T sq(T x)
Definition: Math.hpp:232
GeographicLib::Ellipsoid
Properties of an ellipsoid.
Definition: Ellipsoid.hpp:39
GeographicLib::EllipticFunction::E
Math::real E() const
Definition: EllipticFunction.hpp:202
GeographicLib::Ellipsoid::CircleRadius
Math::real CircleRadius(real phi) const
Definition: src/Ellipsoid.cpp:91
GeographicLib::Math::hypot
static T hypot(T x, T y)
Definition: Math.hpp:243
GeographicLib::Ellipsoid::WGS84
static const Ellipsoid & WGS84()
Definition: src/Ellipsoid.cpp:32
real
Definition: main.h:100
GeographicLib::Ellipsoid::_f12
real _f12
Definition: Ellipsoid.hpp:44
ceres::sqrt
Jet< T, N > sqrt(const Jet< T, N > &f)
Definition: jet.h:418
GeographicLib::Ellipsoid::Area
Math::real Area() const
Definition: src/Ellipsoid.cpp:40


gtsam
Author(s):
autogenerated on Sun Dec 22 2024 04:11:30