10 #if !defined(GEOGRAPHICLIB_RHUMB_HPP)
11 #define GEOGRAPHICLIB_RHUMB_HPP 1
55 static inline real overflow() {
58 overflow = 1 /
Math::sq(std::numeric_limits<real>::epsilon());
61 static inline real tano(real x) {
62 using std::abs;
using std::tan;
64 2 * abs(x) ==
Math::pi() ? (x < 0 ? - overflow() : overflow()) :
67 static inline real gd(real x)
68 {
using std::atan;
using std::sinh;
return atan(sinh(x)); }
81 static inline real Dtan(real x, real y) {
82 real d = x - y, tx = tano(x), ty = tano(y), txy = tx * ty;
83 return d ? (2 * txy > -1 ? (1 + txy) * tano(d) : tx - ty) / d :
86 static inline real Datan(real x, real y) {
88 real d = x - y, xy = x * y;
89 return d ? (2 * xy > -1 ? atan( d / (1 + xy) ) : atan(x) - atan(y)) / d :
92 static inline real Dsin(real x, real y) {
93 using std::sin;
using std::cos;
95 return cos((x + y)/2) * (d ? sin(d) / d : 1);
97 static inline real Dsinh(real x, real y) {
98 using std::sinh;
using std::cosh;
100 return cosh((x + y)/2) * (d ? sinh(d) / d : 1);
102 static inline real Dasinh(real x, real y) {
105 return d ?
Math::asinh(x*y > 0 ? d * (x + y) / (x*hy + y*hx) :
109 static inline real Dgd(real x, real y) {
111 return Datan(sinh(x), sinh(y)) * Dsinh(x, y);
113 static inline real Dgdinv(real x, real y) {
114 return Dasinh(tano(x), tano(y)) * Dtan(x, y);
119 inline real eatanhe(real x)
const {
121 return _ell._f >= 0 ? _ell._e *
Math::atanh(_ell._e * x) :
122 - _ell._e * atan(_ell._e * x);
126 inline real Deatanhe(real x, real y)
const {
127 real t = x - y, d = 1 - _ell._e2 * x * y;
128 return t ? eatanhe(t / d) / t : _ell._e2 / d;
131 real DE(real x, real y)
const;
133 real DRectifying(real latx, real laty)
const;
135 real DIsometric(real latx, real laty)
const;
138 static real SinSeries(real x, real y,
const real c[],
int n);
140 real DConformalToRectifying(real chix, real chiy)
const;
142 real DRectifyingToConformal(real mux, real muy)
const;
145 real DIsometricToRectifying(real psix, real psiy)
const;
147 real DRectifyingToIsometric(real mux, real muy)
const;
166 Rhumb(real a, real f,
bool exact =
true) : _ell(a, f), _exact(exact) {}
191 void Direct(real lat1, real lon1, real azi12, real s12,
192 real& lat2, real& lon2)
const;
214 void Inverse(real lat1, real lon1, real lat2, real lon2,
215 real& s12, real& azi12)
const;
233 RhumbLine Line(real lat1, real lon1, real azi12)
const;
255 static const Rhumb& WGS84();
281 real _lat1, _lon1, _azi12, _salp, _calp, _mu1, _psi1, _r1;
301 void Position(real s12, real& lat2, real& lon2)
const;
337 #endif // GEOGRAPHICLIB_RHUMB_HPP
#define GEOGRAPHICLIB_EXPORT
GeographicLib::Math::real real
Rhumb(real a, real f, bool exact=true)
Math::real Latitude() const
Math::real MajorRadius() const
Math::real MajorRadius() const
Math::real Azimuth() const
Math::real Longitude() const
Namespace for GeographicLib.
#define GEOGRAPHICLIB_TRANSVERSEMERCATOR_ORDER
Header for GeographicLib::Ellipsoid class.
Math::real Flattening() const
Properties of an ellipsoid.
Math::real MajorRadius() const
Header for GeographicLib::Constants class.
Solve of the direct and inverse rhumb problems.
Find a sequence of points on a single rhumb line.
Math::real Flattening() const
Math::real Flattening() const