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 
76  { return Math::atand(_au.tphif(Math::tand(Math::LatFix(xi)))); }
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
Ellipsoid(real a, real f)
Math::real InverseAuthalicLatitude(real xi) const
static T pi()
Definition: Math.hpp:202
Math::real MeridianDistance(real phi) const
static T atand(T x)
Definition: Math.hpp:723
Math::real IsometricLatitude(real phi) const
Math::real ConformalLatitude(real phi) const
double mu
Math::real InverseRectifyingLatitude(real mu) const
Math::real InverseParametricLatitude(real beta) const
static T LatFix(T x)
Definition: Math.hpp:467
Math::real CircleRadius(real phi) const
Mathematical functions needed by GeographicLib.
Definition: Math.hpp:102
static T sind(T x)
Definition: Math.hpp:609
Definition: BFloat16.h:88
static void sincosd(T x, T &sinx, T &cosx)
Definition: Math.hpp:558
Math::real Area() const
Math::real NormalCurvatureRadius(real phi, real azi) const
static T atanh(T x)
Definition: Math.hpp:328
Math::real QuarterMeridian() const
Math::real GeocentricLatitude(real phi) const
EIGEN_DEVICE_FUNC const SinhReturnType sinh() const
static double epsilon
Definition: testRot3.cpp:37
static T asinh(T x)
Definition: Math.hpp:311
EIGEN_DEVICE_FUNC const AtanReturnType atan() const
EllipticFunction _ell
Definition: Ellipsoid.hpp:46
static T hypot(T x, T y)
Definition: Math.hpp:243
static T sq(T x)
Definition: Math.hpp:232
Array< int, Dynamic, 1 > v
Math::real InverseGeocentricLatitude(real theta) const
AlbersEqualArea _au
Definition: Ellipsoid.hpp:47
Definition: main.h:100
Point2(* f)(const Point3 &, OptionalJacobian< 2, 3 >)
Namespace for GeographicLib.
Math::real ParametricLatitude(real phi) const
Math::real InverseIsometricLatitude(real psi) const
static T degree()
Definition: Math.hpp:216
Math::real TransverseCurvatureRadius(real phi) const
Header for GeographicLib::Ellipsoid class.
Math::real RectifyingLatitude(real phi) const
Vector xi
Definition: testPose2.cpp:148
Properties of an ellipsoid.
Definition: Ellipsoid.hpp:39
static T tand(T x)
Definition: Math.hpp:671
Math::real InverseConformalLatitude(real chi) const
Math::real AuthalicLatitude(real phi) const
static const Ellipsoid & WGS84()
Jet< T, N > sqrt(const Jet< T, N > &f)
Definition: jet.h:418
static T tauf(T taup, T es)
Definition: Math.cpp:31
Math::real MeridionalCurvatureRadius(real phi) const
#define abs(x)
Definition: datatypes.h:17
Math::real CircleHeight(real phi) const
static T taupf(T tau, T es)
Definition: Math.cpp:25


gtsam
Author(s):
autogenerated on Tue Jul 4 2023 02:34:12