10#if !defined(GEOGRAPHICLIB_RHUMB_HPP)
11#define GEOGRAPHICLIB_RHUMB_HPP 1
16#if !defined(GEOGRAPHICLIB_RHUMBAREA_ORDER)
21# define GEOGRAPHICLIB_RHUMBAREA_ORDER \
22 (GEOGRAPHICLIB_PRECISION == 2 ? 6 : \
23 (GEOGRAPHICLIB_PRECISION == 1 ? 4 : 8))
29 template<
class T>
class PolygonAreaT;
77 real _rR[maxpow_ + 1];
78 static real gd(real x)
79 {
using std::atan;
using std::sinh;
return atan(sinh(x)); }
93 using std::sqrt;
using std::asinh;
107 return t != 0 ? 2 * asinh(t / (2 * sqrt(x*y))) / t : 1 / x;
113 (2 * txy > -1 ? (1 + txy) *
Math::tand(d) : tx - ty) /
114 (d * Math::degree()) :
119 real d = x - y, xy = x * y;
121 (2 * xy > -1 ? atan( d / (1 + xy) ) : atan(x) - atan(y)) / d :
125 using std::sin;
using std::cos;
126 real d = (x - y) / 2;
127 return cos((x + y)/2) * (d != 0 ? sin(d) / d : 1);
130 using std::sinh;
using std::cosh;
131 real d = (x - y) / 2;
132 return cosh((x + y) / 2) * (d != 0 ? sinh(d) / d : 1);
136 real d = (x - y) / 2;
137 return sinh((x + y) / 2) * (d != 0 ? sinh(d) / d : 1);
140 using std::asinh;
using std::hypot;
142 hx = hypot(
real(1), x), hy = hypot(
real(1), y);
144 asinh(x*y > 0 ? d * (x + y) / (x*hy + y*hx) : x*hy - y*hx) / d :
149 return Datan(sinh(x), sinh(y)) * Dsinh(x, y);
153 {
return Dasinh(x, y) / Datan(x, y); }
157 real t = x - y, d = 1 - _ell._e2 * x * y;
158 return t != 0 ?
Math::eatanhe(t / d, _ell._es) / t : _ell._e2 / d;
168 static real SinCosSeries(
bool sinp,
171 real DConformalToRectifying(
real chix,
real chiy)
const;
177 real DIsometricToRectifying(
real psix,
real psiy)
const;
187 bool,
real s12,
unsigned outmask,
190 GenDirect(lat1, lon1, azi12, s12, outmask, lat2, lon2, S12);
193 unsigned outmask,
real& s12,
real& azi12,
195 GenInverse(lat1, lon1, lat2, lon2, outmask, s12, azi12, S12);
239 LONG_UNROLL = 1U<<15,
285 void Direct(real lat1, real lon1, real azi12, real s12,
286 real& lat2, real& lon2, real& S12)
const {
287 GenDirect(lat1, lon1, azi12, s12,
288 LATITUDE | LONGITUDE | AREA, lat2, lon2, S12);
294 void Direct(real lat1, real lon1, real azi12, real s12,
295 real& lat2, real& lon2)
const {
297 GenDirect(lat1, lon1, azi12, s12, LATITUDE | LONGITUDE, lat2, lon2, t);
328 unsigned outmask,
real& lat2,
real& lon2,
real& S12)
const;
352 void Inverse(real lat1, real lon1, real lat2, real lon2,
353 real& s12, real& azi12, real& S12)
const {
354 GenInverse(lat1, lon1, lat2, lon2,
355 DISTANCE | AZIMUTH | AREA, s12, azi12, S12);
361 void Inverse(real lat1, real lon1, real lat2, real lon2,
362 real& s12, real& azi12)
const {
364 GenInverse(lat1, lon1, lat2, lon2, DISTANCE | AZIMUTH, s12, azi12, t);
437 static const Rhumb& WGS84();
463 real _lat1, _lon1, _azi12, _salp, _calp, _mu1, _psi1, _r1;
535 void Position(real s12, real& lat2, real& lon2, real& S12)
const {
536 GenPosition(s12, LATITUDE | LONGITUDE | AREA, lat2, lon2, S12);
543 void Position(real s12, real& lat2, real& lon2)
const {
545 GenPosition(s12, LATITUDE | LONGITUDE, lat2, lon2, t);
576 void GenPosition(
real s12,
unsigned outmask,
Header for GeographicLib::Constants class.
#define GEOGRAPHICLIB_EXPORT
Header for GeographicLib::Ellipsoid class.
GeographicLib::Math::real real
#define GEOGRAPHICLIB_RHUMBAREA_ORDER
#define GEOGRAPHICLIB_TRANSVERSEMERCATOR_ORDER
Properties of an ellipsoid.
Math::real Flattening() const
Math::real EquatorialRadius() const
static T eatanhe(T x, T es)
Find a sequence of points on a single rhumb line.
void Position(real s12, real &lat2, real &lon2) const
void Position(real s12, real &lat2, real &lon2, real &S12) const
RhumbLine(const RhumbLine &)=default
Math::real EquatorialRadius() const
Math::real Latitude() const
Math::real Azimuth() const
Math::real Flattening() const
Math::real Longitude() const
Solve of the direct and inverse rhumb problems.
Math::real Flattening() const
void Direct(real lat1, real lon1, real azi12, real s12, real &lat2, real &lon2, real &S12) const
void Inverse(real lat1, real lon1, real lat2, real lon2, real &s12, real &azi12, real &S12) const
void Inverse(real lat1, real lon1, real lat2, real lon2, real &s12, real &azi12) const
void Direct(real lat1, real lon1, real azi12, real s12, real &lat2, real &lon2) const
Math::real EquatorialRadius() const
Math::real EllipsoidArea() const
Namespace for GeographicLib.