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))
26 namespace GeographicLib {
29 template <
class T>
class PolygonAreaT;
78 static inline real gd(real x)
79 {
using std::atan;
using std::sinh;
return atan(sinh(x)); }
94 return t ? 2 *
Math::atanh(t / (x + y)) / t : 1 / x;
100 (2 * txy > -1 ? (1 + txy) *
Math::tand(d) : tx - ty) /
101 (d * Math::degree()) :
106 real d = x - y, xy = x * y;
107 return d ? (2 * xy > -1 ? atan( d / (1 + xy) ) : atan(x) - atan(y)) / d :
111 using std::sin;
using std::cos;
112 real d = (x - y) / 2;
113 return cos((x + y)/2) * (d ? sin(d) / d : 1);
116 using std::sinh;
using std::cosh;
117 real d = (x - y) / 2;
118 return cosh((x + y) / 2) * (d ? sinh(d) / d : 1);
122 real d = (x - y) / 2;
123 return sinh((x + y) / 2) * (d ? sinh(d) / d : 1);
128 return d ?
Math::asinh(x*y > 0 ? d * (x + y) / (x*hy + y*hx) :
134 return Datan(sinh(x), sinh(y)) * Dsinh(x, y);
138 {
return Dasinh(x, y) / Datan(x, y); }
142 real t = x - y, d = 1 - _ell._e2 * x * y;
143 return t ?
Math::eatanhe(t / d, _ell._es) / t : _ell._e2 / d;
153 static real SinCosSeries(
bool sinp,
156 real DConformalToRectifying(
real chix,
real chiy)
const;
162 real DIsometricToRectifying(
real psix,
real psiy)
const;
172 bool,
real s12,
unsigned outmask,
175 GenDirect(lat1, lon1, azi12, s12, outmask, lat2, lon2, S12);
178 unsigned outmask,
real& s12,
real& azi12,
180 GenInverse(lat1, lon1, lat2, lon2, outmask, s12, azi12, S12);
225 LONG_UNROLL = 1U<<15,
227 LONG_NOWRAP = LONG_UNROLL,
276 void Direct(real lat1, real lon1, real azi12, real s12,
277 real& lat2, real& lon2, real& S12)
const {
278 GenDirect(lat1, lon1, azi12, s12,
279 LATITUDE | LONGITUDE | AREA, lat2, lon2, S12);
285 void Direct(real lat1, real lon1, real azi12, real s12,
286 real& lat2, real& lon2)
const {
288 GenDirect(lat1, lon1, azi12, s12, LATITUDE | LONGITUDE, lat2, lon2, t);
321 void GenDirect(
real lat1,
real lon1,
real azi12,
real s12,
unsigned outmask,
347 void Inverse(real lat1, real lon1, real lat2, real lon2,
348 real& s12, real& azi12, real& S12)
const {
349 GenInverse(lat1, lon1, lat2, lon2,
350 DISTANCE | AZIMUTH | AREA, s12, azi12, S12);
356 void Inverse(real lat1, real lon1, real lat2, real lon2,
357 real& s12, real& azi12)
const {
359 GenInverse(lat1, lon1, lat2, lon2, DISTANCE | AZIMUTH, s12, azi12, t);
426 static const Rhumb& WGS84();
453 real _lat1, _lon1, _azi12, _salp, _calp, _mu1, _psi1, _r1;
500 LONG_NOWRAP = LONG_UNROLL,
526 void Position(real s12, real& lat2, real& lon2, real& S12)
const {
527 GenPosition(s12, LATITUDE | LONGITUDE | AREA, lat2, lon2, S12);
534 void Position(real s12, real& lat2, real& lon2)
const {
536 GenPosition(s12, LATITUDE | LONGITUDE, lat2, lon2, t);
570 void GenPosition(
real s12,
unsigned outmask,
607 #endif // GEOGRAPHICLIB_RHUMB_HPP
void Inverse(real lat1, real lon1, real lat2, real lon2, real &s12, real &azi12, real &S12) const
#define GEOGRAPHICLIB_EXPORT
GeographicLib::Math::real real
static T eatanhe(T x, T es)
void Position(real s12, real &lat2, real &lon2) const
#define GEOGRAPHICLIB_RHUMBAREA_ORDER
Math::real Latitude() const
Math::real MajorRadius() const
Math::real EllipsoidArea() const
Math::real Azimuth() const
Math::real Longitude() const
#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.
void Inverse(real lat1, real lon1, real lat2, real lon2, real &s12, real &azi12) const
Find a sequence of points on a single rhumb line.
Math::real Flattening() const
void Direct(real lat1, real lon1, real azi12, real s12, real &lat2, real &lon2) const
void Direct(real lat1, real lon1, real azi12, real s12, real &lat2, real &lon2, real &S12) const
void Position(real s12, real &lat2, real &lon2, real &S12) const