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)); }
92 static real Dlog(real x, real y) {
94 return t != 0 ? 2 *
Math::atanh(t / (x + y)) / t : 1 / x;
97 static real Dtan(real x, real y) {
100 (2 * txy > -1 ? (1 + txy) *
Math::tand(d) : tx - ty) /
101 (d *
Math::degree()) :
104 static real Datan(real x, real y) {
106 real d = x - y, xy = x * y;
108 (2 * xy > -1 ? atan( d / (1 + xy) ) : atan(x) - atan(y)) / d :
111 static real Dsin(real x, real y) {
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);
116 static real Dsinh(real x, real y) {
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);
121 static real Dcosh(real x, real y) {
123 real d = (x - y) / 2;
124 return sinh((x + y) / 2) * (d != 0 ? sinh(d) / d : 1);
126 static real Dasinh(real x, real y) {
129 return d != 0 ?
Math::asinh(x*y > 0 ? d * (x + y) / (x*hy + y*hx) :
133 static real Dgd(real x, real y) {
135 return Datan(sinh(x), sinh(y)) * Dsinh(x, y);
138 static real Dgdinv(real x, real y)
139 {
return Dasinh(x, y) / Datan(x, y); }
142 real Deatanhe(real x, real y)
const {
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;
147 real DE(real x, real y)
const;
149 real DRectifying(real latx, real laty)
const;
151 real DIsometric(real latx, real laty)
const;
154 static real SinCosSeries(
bool sinp,
155 real x, real y,
const real c[],
int n);
157 real DConformalToRectifying(real chix, real chiy)
const;
159 real DRectifyingToConformal(real mux, real muy)
const;
163 real DIsometricToRectifying(real psix, real psiy)
const;
165 real DRectifyingToIsometric(real mux, real muy)
const;
167 real MeanSinXi(real psi1, real psi2)
const;
172 void GenDirect(real lat1, real lon1, real azi12,
173 bool, real s12,
unsigned outmask,
174 real& lat2, real& lon2, real&, real&, real&, real&, real&,
176 GenDirect(lat1, lon1, azi12, s12, outmask, lat2, lon2, S12);
178 void GenInverse(real lat1, real lon1, real lat2, real lon2,
179 unsigned outmask, real& s12, real& azi12,
180 real&, real& , real& , real& , real& S12)
const {
181 GenInverse(lat1, lon1, lat2, lon2, outmask, s12, azi12, S12);
225 LONG_UNROLL = 1U<<15,
247 Rhumb(real a, real f,
bool exact =
true);
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);
313 void GenDirect(real lat1, real lon1, real azi12, real s12,
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);
373 void GenInverse(real lat1, real lon1, real lat2, real lon2,
375 real& s12, real& azi12, real& S12)
const;
392 RhumbLine Line(real lat1, real lon1, real azi12)
const;
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,
554 real& lat2, real& lon2, real& S12)
const;
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
Mathematical functions needed by GeographicLib.
#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