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;
78 static inline real gd(real x)
79 {
using std::atan;
using std::sinh;
return atan(sinh(x)); }
92 static inline real Dlog(real x, real y) {
94 return t ? 2 *
Math::atanh(t / (x + y)) / t : 1 / x;
97 static inline real Dtan(real x, real y) {
100 (2 * txy > -1 ? (1 + txy) *
Math::tand(d) : tx - ty) /
101 (d * Math::degree()) :
104 static inline real Datan(real x, real y) {
106 real d = x - y, xy = x * y;
107 return d ? (2 * xy > -1 ? atan( d / (1 + xy) ) : atan(x) - atan(y)) / d :
110 static inline real Dsin(real x, real y) {
111 using std::sin;
using std::cos;
112 real d = (x - y) / 2;
113 return cos((x + y)/2) * (d ? sin(d) / d : 1);
115 static inline real Dsinh(real x, real y) {
116 using std::sinh;
using std::cosh;
117 real d = (x - y) / 2;
118 return cosh((x + y) / 2) * (d ? sinh(d) / d : 1);
120 static inline real Dcosh(real x, real y) {
122 real d = (x - y) / 2;
123 return sinh((x + y) / 2) * (d ? sinh(d) / d : 1);
125 static inline real Dasinh(real x, real y) {
128 return d ?
Math::asinh(x*y > 0 ? d * (x + y) / (x*hy + y*hx) :
132 static inline real Dgd(real x, real y) {
134 return Datan(sinh(x), sinh(y)) * Dsinh(x, y);
137 static inline real Dgdinv(real x, real y)
138 {
return Dasinh(x, y) / Datan(x, y); }
141 inline real Deatanhe(real x, real y)
const {
142 real t = x - y, d = 1 - _ell._e2 * x * y;
143 return t ?
Math::eatanhe(t / d, _ell._es) / t : _ell._e2 / d;
146 real DE(real x, real y)
const;
148 real DRectifying(real latx, real laty)
const;
150 real DIsometric(real latx, real laty)
const;
153 static real SinCosSeries(
bool sinp,
154 real x, real y,
const real c[],
int n);
156 real DConformalToRectifying(real chix, real chiy)
const;
158 real DRectifyingToConformal(real mux, real muy)
const;
162 real DIsometricToRectifying(real psix, real psiy)
const;
164 real DRectifyingToIsometric(real mux, real muy)
const;
166 real MeanSinXi(real psi1, real psi2)
const;
171 void GenDirect(real lat1, real lon1, real azi12,
172 bool, real s12,
unsigned outmask,
173 real& lat2, real& lon2, real&, real&, real&, real&, real&,
175 GenDirect(lat1, lon1, azi12, s12, outmask, lat2, lon2, S12);
177 void GenInverse(real lat1, real lon1, real lat2, real lon2,
178 unsigned outmask, real& s12, real& azi12,
179 real&, real& , real& , real& , real& S12)
const {
180 GenInverse(lat1, lon1, lat2, lon2, outmask, s12, azi12, S12);
225 LONG_UNROLL = 1U<<15,
227 LONG_NOWRAP = LONG_UNROLL,
251 Rhumb(real a, real f,
bool exact =
true);
275 void Direct(real lat1, real lon1, real azi12, real s12,
276 real& lat2, real& lon2, real& S12)
const {
277 GenDirect(lat1, lon1, azi12, s12,
278 LATITUDE | LONGITUDE | AREA, lat2, lon2, S12);
284 void Direct(real lat1, real lon1, real azi12, real s12,
285 real& lat2, real& lon2)
const {
287 GenDirect(lat1, lon1, azi12, s12, LATITUDE | LONGITUDE, lat2, lon2, t);
317 void GenDirect(real lat1, real lon1, real azi12, real s12,
unsigned outmask,
318 real& lat2, real& lon2, real& S12)
const;
342 void Inverse(real lat1, real lon1, real lat2, real lon2,
343 real& s12, real& azi12, real& S12)
const {
344 GenInverse(lat1, lon1, lat2, lon2,
345 DISTANCE | AZIMUTH | AREA, s12, azi12, S12);
351 void Inverse(real lat1, real lon1, real lat2, real lon2,
352 real& s12, real& azi12)
const {
354 GenInverse(lat1, lon1, lat2, lon2, DISTANCE | AZIMUTH, s12, azi12, t);
377 void GenInverse(real lat1, real lon1, real lat2, real lon2,
379 real& s12, real& azi12, real& S12)
const;
396 RhumbLine Line(real lat1, real lon1, real azi12)
const;
420 static const Rhumb& WGS84();
447 real _lat1, _lon1, _azi12, _salp, _calp, _mu1, _psi1, _r1;
494 LONG_NOWRAP = LONG_UNROLL,
520 void Position(real s12, real& lat2, real& lon2, real& S12)
const {
521 GenPosition(s12, LATITUDE | LONGITUDE | AREA, lat2, lon2, S12);
528 void Position(real s12, real& lat2, real& lon2)
const {
530 GenPosition(s12, LATITUDE | LONGITUDE, lat2, lon2, t);
561 void GenPosition(real s12,
unsigned outmask,
562 real& lat2, real& lon2, real& S12)
const;
598 #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 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.
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
Math::real Flattening() 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