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 real gd(real x)
79 {
using std::atan;
using std::sinh;
return atan(sinh(x)); }
94 return t != 0 ? 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;
108 (2 * xy > -1 ? atan( d / (1 + xy) ) : atan(x) - atan(y)) / d :
112 using std::sin;
using std::cos;
113 real d = (x - y) / 2;
114 return cos((x + y)/2) * (d != 0 ? sin(d) / d : 1);
117 using std::sinh;
using std::cosh;
118 real d = (x - y) / 2;
119 return cosh((x + y) / 2) * (d != 0 ? sinh(d) / d : 1);
123 real d = (x - y) / 2;
124 return sinh((x + y) / 2) * (d != 0 ? sinh(d) / d : 1);
129 return d != 0 ?
Math::asinh(x*y > 0 ? d * (x + y) / (x*hy + y*hx) :
135 return Datan(sinh(x), sinh(y)) * Dsinh(x, y);
139 {
return Dasinh(x, y) / Datan(x, y); }
143 real t = x - y, d = 1 - _ell._e2 * x * y;
144 return t != 0 ?
Math::eatanhe(t / d, _ell._es) / t : _ell._e2 / d;
154 static real SinCosSeries(
bool sinp,
157 real DConformalToRectifying(
real chix,
real chiy)
const;
163 real DIsometricToRectifying(
real psix,
real psiy)
const;
173 bool,
real s12,
unsigned outmask,
176 GenDirect(lat1, lon1, azi12, s12, outmask, lat2, lon2, S12);
179 unsigned outmask,
real& s12,
real& azi12,
181 GenInverse(lat1, lon1, lat2, lon2, outmask, s12, azi12, S12);
225 LONG_UNROLL = 1U<<15,
271 void Direct(real lat1, real lon1, real azi12, real s12,
272 real& lat2, real& lon2, real& S12)
const {
273 GenDirect(lat1, lon1, azi12, s12,
274 LATITUDE | LONGITUDE | AREA, lat2, lon2, S12);
280 void Direct(real lat1, real lon1, real azi12, real s12,
281 real& lat2, real& lon2)
const {
283 GenDirect(lat1, lon1, azi12, s12, LATITUDE | LONGITUDE, lat2, lon2, t);
314 unsigned outmask,
real& lat2,
real& lon2,
real& S12)
const;
338 void Inverse(real lat1, real lon1, real lat2, real lon2,
339 real& s12, real& azi12, real& S12)
const {
340 GenInverse(lat1, lon1, lat2, lon2,
341 DISTANCE | AZIMUTH | AREA, s12, azi12, S12);
347 void Inverse(real lat1, real lon1, real lat2, real lon2,
348 real& s12, real& azi12)
const {
350 GenInverse(lat1, lon1, lat2, lon2, DISTANCE | AZIMUTH, s12, azi12, t);
416 static const Rhumb& WGS84();
443 real _lat1, _lon1, _azi12, _salp, _calp, _mu1, _psi1, _r1;
512 void Position(real s12, real& lat2, real& lon2, real& S12)
const {
513 GenPosition(s12, LATITUDE | LONGITUDE | AREA, lat2, lon2, S12);
520 void Position(real s12, real& lat2, real& lon2)
const {
522 GenPosition(s12, LATITUDE | LONGITUDE, lat2, lon2, t);
553 void GenPosition(
real s12,
unsigned outmask,
590 #endif // GEOGRAPHICLIB_RHUMB_HPP
Math::real Flattening() const
#define GEOGRAPHICLIB_EXPORT
void Inverse(real lat1, real lon1, real lat2, real lon2, real &s12, real &azi12) const
GeographicLib::Math::real real
void Position(real s12, real &lat2, real &lon2, real &S12) const
Math::real Latitude() const
#define GEOGRAPHICLIB_RHUMBAREA_ORDER
Math::real Azimuth() const
Math::real Flattening() const
Math::real Longitude() const
Namespace for GeographicLib.
#define GEOGRAPHICLIB_TRANSVERSEMERCATOR_ORDER
Header for GeographicLib::Ellipsoid class.
Properties of an ellipsoid.
void Inverse(real lat1, real lon1, real lat2, real lon2, real &s12, real &azi12, real &S12) const
Math::real MajorRadius() const
void Direct(real lat1, real lon1, real azi12, real s12, real &lat2, real &lon2) const
Header for GeographicLib::Constants class.
Math::real MajorRadius() const
void Position(real s12, real &lat2, real &lon2) const
Solve of the direct and inverse rhumb problems.
Find a sequence of points on a single rhumb line.
Math::real EllipsoidArea() const
Math::real Flattening() const
static T eatanhe(T x, T es)
void Direct(real lat1, real lon1, real azi12, real s12, real &lat2, real &lon2, real &S12) const
Math::real MajorRadius() const