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) {
107 return t != 0 ? 2 *
Math::asinh(t / (2 * sqrt(x*y))) / t : 1 / x;
110 static real Dtan(real x, real y) {
113 (2 * txy > -1 ? (1 + txy) *
Math::tand(d) : tx - ty) /
114 (d *
Math::degree()) :
117 static real Datan(real x, real y) {
119 real d = x - y, xy = x * y;
121 (2 * xy > -1 ? atan( d / (1 + xy) ) : atan(x) - atan(y)) / d :
124 static real Dsin(real x, real y) {
125 using std::sin;
using std::cos;
126 real d = (x - y) / 2;
127 return cos((x + y)/2) * (d != 0 ? sin(d) / d : 1);
129 static real Dsinh(real x, real y) {
130 using std::sinh;
using std::cosh;
131 real d = (x - y) / 2;
132 return cosh((x + y) / 2) * (d != 0 ? sinh(d) / d : 1);
134 static real Dcosh(real x, real y) {
136 real d = (x - y) / 2;
137 return sinh((x + y) / 2) * (d != 0 ? sinh(d) / d : 1);
139 static real Dasinh(real x, real y) {
143 Math::asinh(x*y > 0 ? d * (x + y) / (x*hy + y*hx) : x*hy - y*hx) / d :
146 static real Dgd(real x, real y) {
148 return Datan(sinh(x), sinh(y)) * Dsinh(x, y);
151 static real Dgdinv(real x, real y)
152 {
return Dasinh(x, y) / Datan(x, y); }
155 real Deatanhe(real x, real y)
const {
156 real t = x - y, d = 1 - _ell._e2 * x * y;
157 return t != 0 ?
Math::eatanhe(t / d, _ell._es) / t : _ell._e2 / d;
160 real DE(real x, real y)
const;
162 real DRectifying(real latx, real laty)
const;
164 real DIsometric(real latx, real laty)
const;
167 static real SinCosSeries(
bool sinp,
168 real x, real y,
const real c[],
int n);
170 real DConformalToRectifying(real chix, real chiy)
const;
172 real DRectifyingToConformal(real mux, real muy)
const;
176 real DIsometricToRectifying(real psix, real psiy)
const;
178 real DRectifyingToIsometric(real mux, real muy)
const;
180 real MeanSinXi(real psi1, real psi2)
const;
185 void GenDirect(real lat1, real lon1, real azi12,
186 bool, real s12,
unsigned outmask,
187 real& lat2, real& lon2, real&, real&, real&, real&, real&,
189 GenDirect(lat1, lon1, azi12, s12, outmask, lat2, lon2, S12);
191 void GenInverse(real lat1, real lon1, real lat2, real lon2,
192 unsigned outmask, real& s12, real& azi12,
193 real&, real& , real& , real& , real& S12)
const {
194 GenInverse(lat1, lon1, lat2, lon2, outmask, s12, azi12, S12);
238 LONG_UNROLL = 1U<<15,
260 Rhumb(real a, real f,
bool exact =
true);
284 void Direct(real lat1, real lon1, real azi12, real s12,
285 real& lat2, real& lon2, real& S12)
const {
286 GenDirect(lat1, lon1, azi12, s12,
287 LATITUDE | LONGITUDE | AREA, lat2, lon2, S12);
293 void Direct(real lat1, real lon1, real azi12, real s12,
294 real& lat2, real& lon2)
const {
296 GenDirect(lat1, lon1, azi12, s12, LATITUDE | LONGITUDE, lat2, lon2, t);
326 void GenDirect(real lat1, real lon1, real azi12, real s12,
327 unsigned outmask, real& lat2, real& lon2, real& S12)
const;
351 void Inverse(real lat1, real lon1, real lat2, real lon2,
352 real& s12, real& azi12, real& S12)
const {
353 GenInverse(lat1, lon1, lat2, lon2,
354 DISTANCE | AZIMUTH | AREA, s12, azi12, S12);
360 void Inverse(real lat1, real lon1, real lat2, real lon2,
361 real& s12, real& azi12)
const {
363 GenInverse(lat1, lon1, lat2, lon2, DISTANCE | AZIMUTH, s12, azi12, t);
386 void GenInverse(real lat1, real lon1, real lat2, real lon2,
388 real& s12, real& azi12, real& S12)
const;
405 RhumbLine Line(real lat1, real lon1, real azi12)
const;
442 static const Rhumb& WGS84();
469 real _lat1, _lon1, _azi12, _salp, _calp, _mu1, _psi1, _r1;
538 void Position(real s12, real& lat2, real& lon2, real& S12)
const {
539 GenPosition(s12, LATITUDE | LONGITUDE | AREA, lat2, lon2, S12);
546 void Position(real s12, real& lat2, real& lon2)
const {
548 GenPosition(s12, LATITUDE | LONGITUDE, lat2, lon2, t);
579 void GenPosition(real s12,
unsigned outmask,
580 real& lat2, real& lon2, real& S12)
const;
616 #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 EquatorialRadius() 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
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.
Math::real EquatorialRadius() const
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 EquatorialRadius() const