JacobiConformal.hpp
Go to the documentation of this file.
1 
14 
15 namespace GeographicLib {
42  typedef Math::real real;
45  static void norm(real& x, real& y)
46  { real z = Math::hypot(x, y); x /= z; y /= z; }
47  public:
60  : _a(a), _b(b), _c(c)
61  , _ab2((_a - _b) * (_a + _b))
62  , _bc2((_b - _c) * (_b + _c))
63  , _ac2((_a - _c) * (_a + _c))
64  , _ex(_ab2 / _ac2 * Math::sq(_c / _b), -_ab2 / Math::sq(_b),
65  _bc2 / _ac2 * Math::sq(_a / _b), Math::sq(_a / _b))
66  , _ey(_bc2 / _ac2 * Math::sq(_a / _b), +_bc2 / Math::sq(_b),
67  _ab2 / _ac2 * Math::sq(_c / _b), Math::sq(_c / _b))
68  {
69  if (!(Math::isfinite(_a) && _a >= _b && _b >= _c && _c > 0))
70  throw GeographicErr("JacobiConformal: axes are not in order");
71  if (!(_a > _c))
72  throw GeographicErr
73  ("JacobiConformal: use alternate constructor for sphere");
74  }
90  : _a(a), _b(b), _c(c)
91  , _ab2(ab * (_a + _b))
92  , _bc2(bc * (_b + _c))
93  , _ac2(_ab2 + _bc2)
94  , _ex(_ab2 / _ac2 * Math::sq(_c / _b),
95  -(_a - _b) * (_a + _b) / Math::sq(_b),
96  _bc2 / _ac2 * Math::sq(_a / _b), Math::sq(_a / _b))
97  , _ey(_bc2 / _ac2 * Math::sq(_a / _b),
98  +(_b - _c) * (_b + _c) / Math::sq(_b),
99  _ab2 / _ac2 * Math::sq(_c / _b), Math::sq(_c / _b))
100  {
101  if (!(Math::isfinite(_a) && _a >= _b && _b >= _c && _c > 0 &&
102  ab >= 0 && bc >= 0))
103  throw GeographicErr("JacobiConformal: axes are not in order");
104  if (!(ab + bc > 0 && Math::isfinite(_ac2)))
105  throw GeographicErr("JacobiConformal: ab + bc must be positive");
106  }
110  Math::real x() const { return Math::sq(_a / _b) * _ex.Pi(); }
118  Math::real x(real somg, real comg) const {
119  real somg1 = _b * somg, comg1 = _a * comg; norm(somg1, comg1);
120  return Math::sq(_a / _b)
121  * _ex.Pi(somg1, comg1, _ex.Delta(somg1, comg1));
122  }
131  Math::real x(real omg) const {
132  real somg, comg;
133  Math::sincosd(omg, somg, comg);
134  return x(somg, comg) / Math::degree();
135  }
139  Math::real y() const { return Math::sq(_c / _b) * _ey.Pi(); }
147  Math::real y(real sbet, real cbet) const {
148  real sbet1 = _b * sbet, cbet1 = _c * cbet; norm(sbet1, cbet1);
149  return Math::sq(_c / _b)
150  * _ey.Pi(sbet1, cbet1, _ey.Delta(sbet1, cbet1));
151  }
160  Math::real y(real bet) const {
161  real sbet, cbet;
162  Math::sincosd(bet, sbet, cbet);
163  return y(sbet, cbet) / Math::degree();
164  }
165  };
166 
167 } // namespace GeographicLib
GeographicLib::EllipticFunction::Delta
Math::real Delta(real sn, real cn) const
Definition: EllipticFunction.hpp:584
GeographicLib::JacobiConformal::x
Math::real x(real omg) const
Definition: JacobiConformal.hpp:131
GeographicLib::JacobiConformal::_a
real _a
Definition: JacobiConformal.hpp:43
GeographicLib::JacobiConformal::_ey
EllipticFunction _ey
Definition: JacobiConformal.hpp:44
GeographicLib::JacobiConformal::x
Math::real x() const
Definition: JacobiConformal.hpp:110
GeographicLib::JacobiConformal::JacobiConformal
JacobiConformal(real a, real b, real c)
Definition: JacobiConformal.hpp:59
GeographicLib
Namespace for GeographicLib.
Definition: JacobiConformal.hpp:15
GeographicLib::JacobiConformal::norm
static void norm(real &x, real &y)
Definition: JacobiConformal.hpp:45
c
Scalar Scalar * c
Definition: benchVecAdd.cpp:17
b
Scalar * b
Definition: benchVecAdd.cpp:17
EllipticFunction.hpp
Header for GeographicLib::EllipticFunction class.
GeographicLib::Math::isfinite
static bool isfinite(T x)
Definition: Math.hpp:806
GeographicLib::Math::sincosd
static void sincosd(T x, T &sinx, T &cosx)
Definition: Math.hpp:558
GeographicLib::JacobiConformal::_ab2
real _ab2
Definition: JacobiConformal.hpp:43
GeographicLib::EllipticFunction
Elliptic integrals and functions.
Definition: EllipticFunction.hpp:62
GeographicLib::JacobiConformal::y
Math::real y() const
Definition: JacobiConformal.hpp:139
GeographicLib::JacobiConformal::_bc2
real _bc2
Definition: JacobiConformal.hpp:43
GeographicLib::GeographicErr
Exception handling for GeographicLib.
Definition: Constants.hpp:389
GeographicLib::JacobiConformal::_ac2
real _ac2
Definition: JacobiConformal.hpp:43
GeographicLib::Math::real
double real
Definition: Math.hpp:129
GeographicLib::JacobiConformal::_ex
EllipticFunction _ex
Definition: JacobiConformal.hpp:44
GeographicLib::Math
Mathematical functions needed by GeographicLib.
Definition: Math.hpp:102
GeographicLib::Math::degree
static T degree()
Definition: Math.hpp:216
GeographicLib::JacobiConformal::y
Math::real y(real sbet, real cbet) const
Definition: JacobiConformal.hpp:147
GeographicLib::JacobiConformal::real
Math::real real
Definition: JacobiConformal.hpp:42
GeographicLib::JacobiConformal::_c
real _c
Definition: JacobiConformal.hpp:43
GeographicLib::JacobiConformal::JacobiConformal
JacobiConformal(real a, real b, real c, real ab, real bc)
Definition: JacobiConformal.hpp:89
GeographicLib::JacobiConformal::x
Math::real x(real somg, real comg) const
Definition: JacobiConformal.hpp:118
GeographicLib::JacobiConformal::y
Math::real y(real bet) const
Definition: JacobiConformal.hpp:160
pybind_wrapper_test_script.z
z
Definition: pybind_wrapper_test_script.py:61
a
ArrayXXi a
Definition: Array_initializer_list_23_cxx11.cpp:1
GeographicLib::EllipticFunction::Pi
Math::real Pi() const
Definition: EllipticFunction.hpp:237
GeographicLib::JacobiConformal
Jacobi's conformal projection of a triaxial ellipsoid.
Definition: JacobiConformal.hpp:41
GeographicLib::Math::sq
static T sq(T x)
Definition: Math.hpp:232
GeographicLib::Math::hypot
static T hypot(T x, T y)
Definition: Math.hpp:243
real
Definition: main.h:100
GeographicLib::JacobiConformal::_b
real _b
Definition: JacobiConformal.hpp:43


gtsam
Author(s):
autogenerated on Sat Nov 16 2024 04:02:34