src/CassiniSoldner.cpp
Go to the documentation of this file.
1 
11 
12 namespace GeographicLib {
13 
14  using namespace std;
15 
17  : _earth(earth) {}
18 
20  : _earth(earth)
21  { Reset(lat0, lon0); }
22 
28  real f = _earth.Flattening();
30  _sbet0 *= (1 - f);
32  }
33 
35  real& azi, real& rk) const {
36  if (!Init())
37  return;
39  real sig12, s12, azi1, azi2;
40  sig12 = _earth.Inverse(lat, -abs(dlon), lat, abs(dlon), s12, azi1, azi2);
41  sig12 *= real(0.5);
42  s12 *= real(0.5);
43  if (s12 == 0) {
44  real da = Math::AngDiff(azi1, azi2)/2;
45  if (abs(dlon) <= 90) {
46  azi1 = 90 - da;
47  azi2 = 90 + da;
48  } else {
49  azi1 = -90 - da;
50  azi2 = -90 + da;
51  }
52  }
53  if (dlon < 0) {
54  azi2 = azi1;
55  s12 = -s12;
56  sig12 = -sig12;
57  }
58  x = s12;
59  azi = Math::AngNormalize(azi2);
61  real t;
62  perp.GenPosition(true, -sig12,
64  t, t, t, t, t, t, rk, t);
65 
66  real salp0, calp0;
67  Math::sincosd(perp.EquatorialAzimuth(), salp0, calp0);
68  real
69  sbet1 = lat >=0 ? calp0 : -calp0,
70  cbet1 = abs(dlon) <= 90 ? abs(salp0) : -abs(salp0),
71  sbet01 = sbet1 * _cbet0 - cbet1 * _sbet0,
72  cbet01 = cbet1 * _cbet0 + sbet1 * _sbet0,
73  sig01 = atan2(sbet01, cbet01) / Math::degree();
74  _meridian.GenPosition(true, sig01,
76  t, t, t, y, t, t, t, t);
77  }
78 
80  real& azi, real& rk) const {
81  if (!Init())
82  return;
83  real lat1, lon1;
84  real azi0, t;
85  _meridian.Position(y, lat1, lon1, azi0);
86  _earth.Direct(lat1, lon1, azi0 + 90, x, lat, lon, azi, rk, t);
87  }
88 
89 } // namespace GeographicLib
GeographicLib::Math::AngNormalize
static T AngNormalize(T x)
Definition: Math.hpp:440
GeographicLib::Geodesic::Flattening
Math::real Flattening() const
Definition: Geodesic.hpp:949
GeographicLib::Geodesic::LATITUDE
@ LATITUDE
Definition: Geodesic.hpp:274
GeographicLib::CassiniSoldner::Forward
void Forward(real lat, real lon, real &x, real &y, real &azi, real &rk) const
Definition: src/CassiniSoldner.cpp:34
GeographicLib
Namespace for GeographicLib.
Definition: JacobiConformal.hpp:15
GeographicLib::Geodesic::AZIMUTH
@ AZIMUTH
Definition: Geodesic.hpp:286
GeographicLib::GeodesicLine
A geodesic line.
Definition: GeodesicLine.hpp:71
x
set noclip points set clip one set noclip two set bar set border lt lw set xdata set ydata set zdata set x2data set y2data set boxwidth set dummy x
Definition: gnuplot_common_settings.hh:12
GeographicLib::Geodesic::Inverse
Math::real Inverse(real lat1, real lon1, real lat2, real lon2, real &s12, real &azi1, real &azi2, real &m12, real &M12, real &M21, real &S12) const
Definition: Geodesic.hpp:674
GeographicLib::CassiniSoldner::real
Math::real real
Definition: CassiniSoldner.hpp:71
GeographicLib::Math::sincosd
static void sincosd(T x, T &sinx, T &cosx)
Definition: Math.hpp:558
GeographicLib::Geodesic::Direct
Math::real Direct(real lat1, real lon1, real azi1, real s12, real &lat2, real &lon2, real &azi2, real &m12, real &M12, real &M21, real &S12) const
Definition: Geodesic.hpp:379
GeographicLib::Math::norm
static void norm(T &x, T &y)
Definition: Math.hpp:384
GeographicLib::CassiniSoldner::_sbet0
real _sbet0
Definition: CassiniSoldner.hpp:74
GeographicLib::GeodesicLine::Position
Math::real Position(real s12, real &lat2, real &lon2, real &azi2, real &m12, real &M12, real &M21, real &S12) const
Definition: GeodesicLine.hpp:281
GeographicLib::Geodesic::GEODESICSCALE
@ GEODESICSCALE
Definition: Geodesic.hpp:307
GeographicLib::CassiniSoldner::Reverse
void Reverse(real x, real y, real &lat, real &lon, real &azi, real &rk) const
Definition: src/CassiniSoldner.cpp:79
GeographicLib::GeodesicLine::EquatorialAzimuth
Math::real EquatorialAzimuth() const
Definition: GeodesicLine.hpp:624
GeographicLib::CassiniSoldner::Init
bool Init() const
Definition: CassiniSoldner.hpp:173
GeographicLib::CassiniSoldner::CassiniSoldner
CassiniSoldner(const Geodesic &earth=Geodesic::WGS84())
Definition: src/CassiniSoldner.cpp:16
GeographicLib::Geodesic::LONGITUDE
@ LONGITUDE
Definition: Geodesic.hpp:279
GeographicLib::Math::degree
static T degree()
Definition: Math.hpp:216
GeographicLib::CassiniSoldner::_cbet0
real _cbet0
Definition: CassiniSoldner.hpp:74
GeographicLib::CassiniSoldner::_earth
Geodesic _earth
Definition: CassiniSoldner.hpp:72
example::lat0
const double lat0
Definition: testGPSFactor.cpp:41
example::lon0
const double lon0
Definition: testGPSFactor.cpp:41
GeographicLib::Math::AngDiff
static T AngDiff(T x, T y, T &e)
Definition: Math.hpp:486
GeographicLib::Geodesic::DISTANCE
@ DISTANCE
Definition: Geodesic.hpp:291
GeographicLib::Geodesic::Line
GeodesicLine Line(real lat1, real lon1, real azi1, unsigned caps=ALL) const
Definition: src/Geodesic.cpp:118
GeographicLib::CassiniSoldner::_meridian
GeodesicLine _meridian
Definition: CassiniSoldner.hpp:73
GeographicLib::CassiniSoldner::LongitudeOrigin
Math::real LongitudeOrigin() const
Definition: CassiniSoldner.hpp:184
CassiniSoldner.hpp
Header for GeographicLib::CassiniSoldner class.
y
Scalar * y
Definition: level1_cplx_impl.h:124
atan2
AnnoyingScalar atan2(const AnnoyingScalar &y, const AnnoyingScalar &x)
Definition: AnnoyingScalar.h:110
tree::f
Point2(* f)(const Point3 &, OptionalJacobian< 2, 3 >)
Definition: testExpression.cpp:218
GeographicLib::CassiniSoldner::Reset
void Reset(real lat0, real lon0)
Definition: src/CassiniSoldner.cpp:23
GeographicLib::GeodesicLine::GenPosition
Math::real GenPosition(bool arcmode, real s12_a12, unsigned outmask, real &lat2, real &lon2, real &azi2, real &s12, real &m12, real &M12, real &M21, real &S12) const
Definition: src/GeodesicLine.cpp:136
std
Definition: BFloat16.h:88
GeographicLib::CassiniSoldner::LatitudeOrigin
Math::real LatitudeOrigin() const
Definition: CassiniSoldner.hpp:178
abs
#define abs(x)
Definition: datatypes.h:17
lon
static const double lon
Definition: testGeographicLib.cpp:34
align_3::t
Point2 t(10, 10)
real
Definition: main.h:100
GeographicLib::Geodesic
Geodesic calculations
Definition: Geodesic.hpp:172
lat
static const double lat
Definition: testGeographicLib.cpp:34
GeographicLib::Geodesic::DISTANCE_IN
@ DISTANCE_IN
Definition: Geodesic.hpp:297


gtsam
Author(s):
autogenerated on Fri Nov 1 2024 03:32:05