GeographicLib 2.7

Loading...
Searching...
No Matches
GeographicLib::EllipticFunction Class Reference

Elliptic integrals and functions. More...

`#include <GeographicLib/EllipticFunction.hpp>`

## Public Member Functions
Constructor
| EllipticFunction (real k2=0, real alpha2=0)
| EllipticFunction (real k2, real alpha2, real kp2, real alphap2)
void | Reset (real k2=0, real alpha2=0)
void | Reset (real k2, real alpha2, real kp2, real alphap2)
Inspector functions.
Math::real | k2 () const
Math::real | kp2 () const
Math::real | alpha2 () const
Math::real | alphap2 () const
Complete elliptic integrals.
Math::real | K () const
Math::real | E () const
Math::real | D () const
Math::real | KE () const
Math::real | Pi () const
Math::real | G () const
Math::real | H () const
Incomplete elliptic integrals.
Math::real | F (real phi) const
Math::real | E (real phi) const
Math::real | Ed (real ang) const
Math::real | Einv (real x) const
Math::real | Pi (real phi) const
Math::real | D (real phi) const
Math::real | G (real phi) const
Math::real | H (real phi) const
Incomplete integrals in terms of Jacobi elliptic functions.
Math::real | F (real sn, real cn, real dn) const
Math::real | E (real sn, real cn, real dn) const
Math::real | Pi (real sn, real cn, real dn) const
Math::real | D (real sn, real cn, real dn) const
Math::real | G (real sn, real cn, real dn) const
Math::real | H (real sn, real cn, real dn) const
Periodic versions of incomplete elliptic integrals.
Math::real | deltaF (real sn, real cn, real dn) const
Math::real | deltaE (real sn, real cn, real dn) const
Math::real | deltaEinv (real stau, real ctau) const
Math::real | deltaPi (real sn, real cn, real dn) const
Math::real | deltaD (real sn, real cn, real dn) const
Math::real | deltaG (real sn, real cn, real dn) const
Math::real | deltaH (real sn, real cn, real dn) const
Elliptic functions.
Math::real | am (real x) const
Math::real | am (real x, real &sn, real &cn, real &dn) const
void | sncndn (real x, real &sn, real &cn, real &dn) const
Math::real | Delta (real sn, real cn) const

## Static Public Member Functions
Symmetric elliptic integrals.
static real | RF (real x, real y, real z)
static real | RF (real x, real y)
static real | RC (real x, real y)
static real | RG (real x, real y, real z)
static real | RG (real x, real y)
static real | RJ (real x, real y, real z, real p)
static real | RD (real x, real y, real z)

## Detailed Description

Elliptic integrals and functions.

This provides the elliptic functions and integrals needed for Ellipsoid, GeodesicExact, and TransverseMercatorExact. Two categories of function are provided:

- static functions to compute symmetric elliptic integrals (https://dlmf.nist.gov/19.16.i)
- member functions to compute Legrendre's elliptic integrals (https://dlmf.nist.gov/19.2.ii) and the Jacobi elliptic functions (https://dlmf.nist.gov/22.2).

In the latter case, an object is constructed giving the modulus k (and optionally the parameter α2). The modulus is always passed as its square k2 which allows k to be pure imaginary (k2 < 0). (Confusingly, Abramowitz and Stegun call m = k2 the "parameter" and n = α2 the "characteristic".)

In geodesic applications, it is convenient to separate the incomplete integrals into secular and periodic components, e.g.,

\[ E(\phi, k) = (2 E(k) / \pi) [ \phi + \delta E(\phi, k) ] \]

where δE(φ, k) is an odd periodic function with period π.

The computation of the elliptic integrals uses the algorithms given in

- B. C. Carlson, Computation of real or complex elliptic integrals, Numerical Algorithms 10, 13–26 (1995); preprint.

with the additional optimizations given in https://dlmf.nist.gov/19.36.i. The computation of the Jacobi elliptic functions uses the algorithm given in

- R. Bulirsch, Numerical Calculation of Elliptic Integrals and Elliptic Functions, Numericshe Mathematik 7, 78–90 (1965).

The notation follows https://dlmf.nist.gov/19 and https://dlmf.nist.gov/22

Example of use:

// Example of using the GeographicLib::EllipticFunction class
#include <iostream>
#include <iomanip>
#include <exception>
#include <cmath>
#include <GeographicLib/Math.hpp>
#include <GeographicLib/EllipticFunction.hpp>
using namespace std;
using namespace GeographicLib;
int main() {
try {
EllipticFunction ell(0.1); // parameter m = 0.1
// See Abramowitz and Stegun, table 17.1
cout << ell.K() << " " << ell.E() << "\n";
double phi = 20, sn, cn;
Math::sincosd(phi, sn ,cn);
// See Abramowitz and Stegun, table 17.6 with
// alpha = asin(sqrt(m)) = 18.43 deg and phi = 20 deg
cout << ell.E(phi * Math::degree()) << " "
<< ell.E(sn, cn, ell.Delta(sn, cn))
<< "\n";
// See Carlson 1995, Sec 3.
cout << fixed << setprecision(16)
<< "RF(1,2,0) = " << EllipticFunction::RF(1,2) << "\n"
<< "RF(2,3,4) = " << EllipticFunction::RF(2,3,4) << "\n"
<< "RC(0,1/4) = " << EllipticFunction::RC(0,0.25) << "\n"
<< "RC(9/4,2) = " << EllipticFunction::RC(2.25,2) << "\n"
<< "RC(1/4,-2) = " << EllipticFunction::RC(0.25,-2) << "\n"
<< "RJ(0,1,2,3) = " << EllipticFunction::RJ(0,1,2,3) << "\n"
<< "RJ(2,3,4,5) = " << EllipticFunction::RJ(2,3,4,5) << "\n"
<< "RD(0,2,1) = " << EllipticFunction::RD(0,2,1) << "\n"
<< "RD(2,3,4) = " << EllipticFunction::RD(2,3,4) << "\n"
<< "RG(0,16,16) = " << EllipticFunction::RG(16,16) << "\n"
<< "RG(2,3,4) = " << EllipticFunction::RG(2,3,4) << "\n"
<< "RG(0,0.0796,4) = " << EllipticFunction::RG(0.0796,4) << "\n";
}
catch (const exception& e) {
cout << "Caught exception: " << e.what() << "\n";
}
}
main
int main(int argc, const char *const argv[])
Definition Cart3Convert.cpp:52
EllipticFunction.hpp
Header for GeographicLib::EllipticFunction class.
Math.hpp
Header for GeographicLib::Math class.
GeographicLib::EllipticFunction::RJ
static real RJ(real x, real y, real z, real p)
Definition EllipticFunction.cpp:123
GeographicLib::EllipticFunction::RG
static real RG(real x, real y, real z)
Definition EllipticFunction.cpp:91
GeographicLib::EllipticFunction::RC
static real RC(real x, real y)
Definition EllipticFunction.cpp:76
GeographicLib::EllipticFunction::EllipticFunction
EllipticFunction(real k2=0, real alpha2=0)
Definition EllipticFunction.hpp:90
GeographicLib::EllipticFunction::RD
static real RD(real x, real y, real z)
Definition EllipticFunction.cpp:177
GeographicLib::EllipticFunction::RF
static real RF(real x, real y, real z)
Definition EllipticFunction.cpp:24
GeographicLib::Math::degree
static T degree()
Definition Math.hpp:197
GeographicLib::Math::sincosd
static void sincosd(T x, T &sinx, T &cosx)
Definition Math.cpp:104
GeographicLib
Namespace for GeographicLib.
Definition Accumulator.cpp:12
std
Definition NearestNeighbor.hpp:806

Definition at line 63 of file EllipticFunction.hpp.

## Constructor & Destructor Documentation

## ◆ EllipticFunction() [1/2]

GeographicLib::EllipticFunction::EllipticFunction | ( | real | k2 = 0,
|  | real | alpha2 = 0 )
| inline

Constructor specifying the modulus and parameter.

Parameters

  [in] | k2 | the square of the modulus k2. k2 must lie in (−∞, 1].
  [in] | alpha2 | the parameter α2. α2 must lie in (−∞, 1].

Exceptions

  GeographicErr | if k2 or alpha2 is out of its legal range.

If only elliptic integrals of the first and second kinds are needed, then set α2 = 0 (the default value); in this case, we have Π(φ, 0, k) = F(φ, k), G(φ, 0, k) = E(φ, k), and H(φ, 0, k) = F(φ, k) - D(φ, k).

Definition at line 90 of file EllipticFunction.hpp.

References alpha2(), k2(), and Reset().

## ◆ EllipticFunction() [2/2]

GeographicLib::EllipticFunction::EllipticFunction | ( | real | k2,
|  | real | alpha2,
|  | real | kp2,
|  | real | alphap2 )
| inline

Constructor specifying the modulus and parameter and their complements.

Parameters

  [in] | k2 | the square of the modulus k2. k2 must lie in (−∞, 1].
  [in] | alpha2 | the parameter α2. α2 must lie in (−∞, 1].
  [in] | kp2 | the complementary modulus squared k'2 = 1 − k2. This must lie in [0, ∞).
  [in] | alphap2 | the complementary parameter α'2 = 1 − α2. This must lie in [0, ∞).

Exceptions

  GeographicErr | if k2, alpha2, kp2, or alphap2 is out of its legal range.

The arguments must satisfy k2 + kp2 = 1 and alpha2 + alphap2 = 1. (No checking is done that these conditions are met.) This constructor is provided to enable accuracy to be maintained, e.g., when k is very close to unity.

Definition at line 112 of file EllipticFunction.hpp.

References alpha2(), alphap2(), k2(), kp2(), and Reset().

## Member Function Documentation

## ◆ Reset() [1/2]

void GeographicLib::EllipticFunction::Reset | ( | real | k2 = 0,
|  | real | alpha2 = 0 )
| inline

Reset the modulus and parameter.

Parameters

  [in] | k2 | the new value of square of the modulus k2 which must lie in (−∞, ]. done.)
  [in] | alpha2 | the new value of parameter α2. α2 must lie in (−∞, 1].

Exceptions

  GeographicErr | if k2 or alpha2 is out of its legal range.

Definition at line 126 of file EllipticFunction.hpp.

References alpha2(), k2(), and Reset().

Referenced by EllipticFunction(), EllipticFunction(), and Reset().

## ◆ Reset() [2/2]

void GeographicLib::EllipticFunction::Reset | ( | real | k2,
|  | real | alpha2,
|  | real | kp2,
|  | real | alphap2 )

Reset the modulus and parameter supplying also their complements.

Parameters

  [in] | k2 | the square of the modulus k2. k2 must lie in (−∞, 1].
  [in] | alpha2 | the parameter α2. α2 must lie in (−∞, 1].
  [in] | kp2 | the complementary modulus squared k'2 = 1 − k2. This must lie in [0, ∞).
  [in] | alphap2 | the complementary parameter α'2 = 1 − α2. This must lie in [0, ∞).

Exceptions

  GeographicErr | if k2, alpha2, kp2, or alphap2 is out of its legal range.

The arguments must satisfy k2 + kp2 = 1 and alpha2 + alphap2 = 1. (No checking is done that these conditions are met.) This constructor is provided to enable accuracy to be maintained, e.g., when is very small.

Definition at line 221 of file EllipticFunction.cpp.

References alpha2(), alphap2(), GeographicLib::Math::infinity(), k2(), kp2(), GeographicLib::Math::pi(), RC(), RD(), RF(), RG(), RJ(), and GeographicLib::Math::sq().

## ◆ k2()

Math::real GeographicLib::EllipticFunction::k2 | ( |  | ) | const
| inline

Returns
  the square of the modulus k2.

Definition at line 158 of file EllipticFunction.hpp.

Referenced by am(), EllipticFunction(), EllipticFunction(), Reset(), and Reset().

## ◆ kp2()

Math::real GeographicLib::EllipticFunction::kp2 | ( |  | ) | const
| inline

Returns
  the square of the complementary modulus k'2 = 1 − k2.

Definition at line 164 of file EllipticFunction.hpp.

Referenced by am(), EllipticFunction(), and Reset().

## ◆ alpha2()

Math::real GeographicLib::EllipticFunction::alpha2 | ( |  | ) | const
| inline

Returns
  the parameter α2.

Definition at line 169 of file EllipticFunction.hpp.

Referenced by EllipticFunction(), EllipticFunction(), Reset(), and Reset().

## ◆ alphap2()

Math::real GeographicLib::EllipticFunction::alphap2 | ( |  | ) | const
| inline

Returns
  the complementary parameter α'2 = 1 − α2.

Definition at line 175 of file EllipticFunction.hpp.

Referenced by EllipticFunction(), and Reset().

## ◆ K()

Math::real GeographicLib::EllipticFunction::K | ( |  | ) | const
| inline

The complete integral of the first kind.

Returns
  K(k).

K(k) is defined in https://dlmf.nist.gov/19.2.E4

\[ K(k) = \int_0^{\pi/2} \frac1{\sqrt{1-k^2\sin^2\phi}}\,d\phi. \]

Definition at line 191 of file EllipticFunction.hpp.

Referenced by deltaF(), F(), and F().

## ◆ E() [1/3]

Math::real GeographicLib::EllipticFunction::E | ( |  | ) | const
| inline

The complete integral of the second kind.

Returns
  E(k).

E(k) is defined in https://dlmf.nist.gov/19.2.E5

\[ E(k) = \int_0^{\pi/2} \sqrt{1-k^2\sin^2\phi}\,d\phi. \]

Definition at line 203 of file EllipticFunction.hpp.

Referenced by deltaE(), deltaEinv(), E(), E(), Ed(), and Einv().

## ◆ D() [1/3]

Math::real GeographicLib::EllipticFunction::D | ( |  | ) | const
| inline

Jahnke's complete integral.

Returns
  D(k).

D(k) is defined in https://dlmf.nist.gov/19.2.E6

\[ D(k) = \int_0^{\pi/2} \frac{\sin^2\phi}{\sqrt{1-k^2\sin^2\phi}}\,d\phi. \]

Definition at line 216 of file EllipticFunction.hpp.

Referenced by D(), D(), and deltaD().

## ◆ KE()

Math::real GeographicLib::EllipticFunction::KE | ( |  | ) | const
| inline

The difference between the complete integrals of the first and second kinds.

Returns
  K(k) − E(k).

Definition at line 224 of file EllipticFunction.hpp.

## ◆ Pi() [1/3]

Math::real GeographicLib::EllipticFunction::Pi | ( |  | ) | const
| inline

The complete integral of the third kind.

Returns
  Π(α2, k).

Π(α2, k) is defined in https://dlmf.nist.gov/19.2.E7

\[ \Pi(\alpha^2, k) = \int_0^{\pi/2} \frac1{\sqrt{1-k^2\sin^2\phi}(1 - \alpha^2\sin^2\phi)}\,d\phi. \]

Definition at line 238 of file EllipticFunction.hpp.

Referenced by deltaPi(), Pi(), and Pi().

## ◆ G() [1/3]

Math::real GeographicLib::EllipticFunction::G | ( |  | ) | const
| inline

Legendre's complete geodesic longitude integral.

Returns
  G(α2, k).

G(α2, k) is given by

\[ G(\alpha^2, k) = \int_0^{\pi/2} \frac{\sqrt{1-k^2\sin^2\phi}}{1 - \alpha^2\sin^2\phi}\,d\phi. \]

Definition at line 251 of file EllipticFunction.hpp.

Referenced by deltaG(), G(), and G().

## ◆ H() [1/3]

Math::real GeographicLib::EllipticFunction::H | ( |  | ) | const
| inline

Cayley's complete geodesic longitude difference integral.

Returns
  H(α2, k).

H(α2, k) is given by

\[ H(\alpha^2, k) = \int_0^{\pi/2} \frac{\cos^2\phi}{(1-\alpha^2\sin^2\phi)\sqrt{1-k^2\sin^2\phi}} \,d\phi. \]

Definition at line 265 of file EllipticFunction.hpp.

Referenced by deltaH(), H(), and H().

## ◆ F() [1/2]

Math::real GeographicLib::EllipticFunction::F | ( | real | phi | ) | const

The incomplete integral of the first kind.

Parameters

  [in] | phi |

Returns
  F(φ, k).

F(φ, k) is defined in https://dlmf.nist.gov/19.2.E4

\[ F(\phi, k) = \int_0^\phi \frac1{\sqrt{1-k^2\sin^2\theta}}\,d\theta. \]

Definition at line 555 of file EllipticFunction.cpp.

References Delta(), deltaF(), F(), K(), and GeographicLib::Math::pi().

Referenced by deltaF(), and F().

## ◆ E() [2/3]

Math::real GeographicLib::EllipticFunction::E | ( | real | phi | ) | const

The incomplete integral of the second kind.

Parameters

  [in] | phi |

Returns
  E(φ, k).

E(φ, k) is defined in https://dlmf.nist.gov/19.2.E5

\[ E(\phi, k) = \int_0^\phi \sqrt{1-k^2\sin^2\theta}\,d\theta. \]

Definition at line 565 of file EllipticFunction.cpp.

References Delta(), deltaE(), E(), and GeographicLib::Math::pi().

## ◆ Ed()

Math::real GeographicLib::EllipticFunction::Ed | ( | real | ang | ) | const

The incomplete integral of the second kind with the argument given in degrees.

Parameters

  [in] | ang | in degrees.

Returns
  E(π ang/180, k).

Definition at line 577 of file EllipticFunction.cpp.

References GeographicLib::Math::AngNormalize(), Delta(), E(), GeographicLib::Math::sincosd(), and GeographicLib::Math::td.

## ◆ Einv()

Math::real GeographicLib::EllipticFunction::Einv | ( | real | x | ) | const

The inverse of the incomplete integral of the second kind.

Parameters

  [in] | x |

Returns
  φ = E−1(x, k); i.e., the solution of such that E(φ, k) = x.

Definition at line 609 of file EllipticFunction.cpp.

References Delta(), E(), GEOGRAPHICLIB_PANIC, and GeographicLib::Math::pi().

Referenced by deltaEinv().

## ◆ Pi() [2/3]

Math::real GeographicLib::EllipticFunction::Pi | ( | real | phi | ) | const

The incomplete integral of the third kind.

Parameters

  [in] | phi |

Returns
  Π(φ, α2, k).

Π(φ, α2, k) is defined in https://dlmf.nist.gov/19.2.E7

\[ \Pi(\phi, \alpha^2, k) = \int_0^\phi \frac1{\sqrt{1-k^2\sin^2\theta}(1 - \alpha^2\sin^2\theta)}\,d\theta. \]

Definition at line 585 of file EllipticFunction.cpp.

References Delta(), deltaPi(), Pi(), and GeographicLib::Math::pi().

## ◆ D() [2/3]

Math::real GeographicLib::EllipticFunction::D | ( | real | phi | ) | const

Jahnke's incomplete elliptic integral.

Parameters

  [in] | phi |

Returns
  D(φ, k).

D(φ, k) is defined in https://dlmf.nist.gov/19.2.E4

\[ D(\phi, k) = \int_0^\phi \frac{\sin^2\theta}{\sqrt{1-k^2\sin^2\theta}}\,d\theta. \]

Definition at line 591 of file EllipticFunction.cpp.

References D(), Delta(), deltaD(), and GeographicLib::Math::pi().

## ◆ G() [2/3]

Math::real GeographicLib::EllipticFunction::G | ( | real | phi | ) | const

Legendre's geodesic longitude integral.

Parameters

  [in] | phi |

Returns
  G(φ, α2, k).

G(φ, α2, k) is defined by

\[ \begin{align} G(\phi, \alpha^2, k) &= \frac{k^2}{\alpha^2} F(\phi, k) + \biggl(1 - \frac{k^2}{\alpha^2}\biggr) \Pi(\phi, \alpha^2, k) \\ &= \int_0^\phi \frac{\sqrt{1-k^2\sin^2\theta}}{1 - \alpha^2\sin^2\theta}\,d\theta. \end{align} \]

Legendre expresses the longitude of a point on the geodesic in terms of this combination of elliptic integrals in Exercices de Calcul Intégral, Vol. 1 (1811), p. 181, https://books.google.com/books?id=riIOAAAAQAAJ&pg=PA181.

See Geodesics in terms of elliptic integrals for the expression for the longitude in terms of this function.

Definition at line 597 of file EllipticFunction.cpp.

References Delta(), deltaG(), G(), and GeographicLib::Math::pi().

## ◆ H() [2/3]

Math::real GeographicLib::EllipticFunction::H | ( | real | phi | ) | const

Cayley's geodesic longitude difference integral.

Parameters

  [in] | phi |

Returns
  H(φ, α2, k).

H(φ, α2, k) is defined by

\[ \begin{align} H(\phi, \alpha^2, k) &= \frac1{\alpha^2} F(\phi, k) + \biggl(1 - \frac1{\alpha^2}\biggr) \Pi(\phi, \alpha^2, k) \\ &= \int_0^\phi \frac{\cos^2\theta} {(1-\alpha^2\sin^2\theta)\sqrt{1-k^2\sin^2\theta}} \,d\theta. \end{align} \]

Cayley expresses the longitude difference of a point on the geodesic in terms of this combination of elliptic integrals in Phil. Mag. 40 (1870), p. 333, https://books.google.com/books?id=Zk0wAAAAIAAJ&pg=PA333.

See Geodesics in terms of elliptic integrals for the expression for the longitude in terms of this function.

Definition at line 603 of file EllipticFunction.cpp.

References Delta(), deltaH(), H(), and GeographicLib::Math::pi().

## ◆ F() [2/2]

Math::real GeographicLib::EllipticFunction::F | ( | real | sn,
|  | real | cn,
|  | real | dn ) const

The incomplete integral of the first kind in terms of Jacobi elliptic functions.

Parameters

  [in] | sn | = sinφ.
  [in] | cn | = cosφ.
  [in] | dn | = sqrt(1 − k2 sin2φ).

Returns
  F(φ, k) as though φ ∈ (−π, π].

Definition at line 431 of file EllipticFunction.cpp.

References K(), and RF().

## ◆ E() [3/3]

Math::real GeographicLib::EllipticFunction::E | ( | real | sn,
|  | real | cn,
|  | real | dn ) const

The incomplete integral of the second kind in terms of Jacobi elliptic functions.

Parameters

  [in] | sn | = sinφ.
  [in] | cn | = cosφ.
  [in] | dn | = sqrt(1 − k2 sin2φ).

Returns
  E(φ, k) as though φ ∈ (−π, π].

Definition at line 442 of file EllipticFunction.cpp.

References E(), RD(), and RF().

## ◆ Pi() [3/3]

Math::real GeographicLib::EllipticFunction::Pi | ( | real | sn,
|  | real | cn,
|  | real | dn ) const

The incomplete integral of the third kind in terms of Jacobi elliptic functions.

Parameters

  [in] | sn | = sinφ.
  [in] | cn | = cosφ.
  [in] | dn | = sqrt(1 − k2 sin2φ).

Returns
  Π(φ, α2, k) as though φ ∈ (−π, π].

Definition at line 477 of file EllipticFunction.cpp.

References Pi(), RF(), and RJ().

## ◆ D() [3/3]

Math::real GeographicLib::EllipticFunction::D | ( | real | sn,
|  | real | cn,
|  | real | dn ) const

Jahnke's incomplete elliptic integral in terms of Jacobi elliptic functions.

Parameters

  [in] | sn | = sinφ.
  [in] | cn | = cosφ.
  [in] | dn | = sqrt(1 − k2 sin2φ).

Returns
  D(φ, k) as though φ ∈ (−π, π].

Definition at line 465 of file EllipticFunction.cpp.

References D(), and RD().

## ◆ G() [3/3]

Math::real GeographicLib::EllipticFunction::G | ( | real | sn,
|  | real | cn,
|  | real | dn ) const

Legendre's geodesic longitude integral in terms of Jacobi elliptic functions.

Parameters

  [in] | sn | = sinφ.
  [in] | cn | = cosφ.
  [in] | dn | = sqrt(1 − k2 sin2φ).

Returns
  G(φ, α2, k) as though φ ∈ (−π, π].

Definition at line 492 of file EllipticFunction.cpp.

References G(), RF(), and RJ().

## ◆ H() [3/3]

Math::real GeographicLib::EllipticFunction::H | ( | real | sn,
|  | real | cn,
|  | real | dn ) const

Cayley's geodesic longitude difference integral in terms of Jacobi elliptic functions.

Parameters

  [in] | sn | = sinφ.
  [in] | cn | = cosφ.
  [in] | dn | = sqrt(1 − k2 sin2φ).

Returns
  H(φ, α2, k) as though φ ∈ (−π, π].

Definition at line 505 of file EllipticFunction.cpp.

References H(), RF(), and RJ().

## ◆ deltaF()

Math::real GeographicLib::EllipticFunction::deltaF | ( | real | sn,
|  | real | cn,
|  | real | dn ) const

The periodic incomplete integral of the first kind.

Parameters

  [in] | sn | = sinφ.
  [in] | cn | = cosφ.
  [in] | dn | = sqrt(1 − k2 sin2φ).

Returns
  the periodic function π F(φ, k) / (2 K(k)) - φ.

Definition at line 519 of file EllipticFunction.cpp.

References F(), K(), and GeographicLib::Math::pi().

Referenced by F().

## ◆ deltaE()

Math::real GeographicLib::EllipticFunction::deltaE | ( | real | sn,
|  | real | cn,
|  | real | dn ) const

The periodic incomplete integral of the second kind.

Parameters

  [in] | sn | = sinφ.
  [in] | cn | = cosφ.
  [in] | dn | = sqrt(1 − k2 sin2φ).

Returns
  the periodic function π E(φ, k) / (2 E(k)) - φ.

Definition at line 525 of file EllipticFunction.cpp.

References E(), and GeographicLib::Math::pi().

Referenced by E().

## ◆ deltaEinv()

Math::real GeographicLib::EllipticFunction::deltaEinv | ( | real | stau,
|  | real | ctau ) const

The periodic inverse of the incomplete integral of the second kind.

Parameters

  [in] | stau | = sinτ.
  [in] | ctau | = sinτ.

Returns
  the periodic function E−1(τ (2 E(k)/π), k) - τ.

Definition at line 637 of file EllipticFunction.cpp.

References E(), Einv(), and GeographicLib::Math::pi().

## ◆ deltaPi()

Math::real GeographicLib::EllipticFunction::deltaPi | ( | real | sn,
|  | real | cn,
|  | real | dn ) const

The periodic incomplete integral of the third kind.

Parameters

  [in] | sn | = sinφ.
  [in] | cn | = cosφ.
  [in] | dn | = sqrt(1 − k2 sin2φ).

Returns
  the periodic function π Π(φ, α2, k) / (2 Π(α2, k)) - φ.

Definition at line 531 of file EllipticFunction.cpp.

References Pi(), and GeographicLib::Math::pi().

Referenced by Pi().

## ◆ deltaD()

Math::real GeographicLib::EllipticFunction::deltaD | ( | real | sn,
|  | real | cn,
|  | real | dn ) const

The periodic Jahnke's incomplete elliptic integral.

Parameters

  [in] | sn | = sinφ.
  [in] | cn | = cosφ.
  [in] | dn | = sqrt(1 − k2 sin2φ).

Returns
  the periodic function π D(φ, k) / (2 D(k)) - φ.

Definition at line 537 of file EllipticFunction.cpp.

References D(), and GeographicLib::Math::pi().

Referenced by D().

## ◆ deltaG()

Math::real GeographicLib::EllipticFunction::deltaG | ( | real | sn,
|  | real | cn,
|  | real | dn ) const

Legendre's periodic geodesic longitude integral.

Parameters

  [in] | sn | = sinφ.
  [in] | cn | = cosφ.
  [in] | dn | = sqrt(1 − k2 sin2φ).

Returns
  the periodic function π G(φ, k) / (2 G(k)) - φ.

Definition at line 543 of file EllipticFunction.cpp.

References G(), and GeographicLib::Math::pi().

Referenced by G().

## ◆ deltaH()

Math::real GeographicLib::EllipticFunction::deltaH | ( | real | sn,
|  | real | cn,
|  | real | dn ) const

Cayley's periodic geodesic longitude difference integral.

Parameters

  [in] | sn | = sinφ.
  [in] | cn | = cosφ.
  [in] | dn | = sqrt(1 − k2 sin2φ).

Returns
  the periodic function π H(φ, k) / (2 H(k)) - φ.

Definition at line 549 of file EllipticFunction.cpp.

References H(), and GeographicLib::Math::pi().

Referenced by H().

## ◆ am() [1/2]

Math::real GeographicLib::EllipticFunction::am | ( | real | x | ) | const

The Jacobi amplitude function.

Parameters

  [in] | x | the argument.

Returns
  the value of am(x, k)

Definition at line 378 of file EllipticFunction.cpp.

References GEOGRAPHICLIB_PANIC, k2(), and kp2().

Referenced by am().

## ◆ am() [2/2]

Math::real GeographicLib::EllipticFunction::am | ( | real | x,
|  | real & | sn,
|  | real & | cn,
|  | real & | dn ) const

The Jacobi amplitude function and associated elliptic functions.

Parameters

  [in] | x | the argument.
  [out] | sn | sn(x, k).
  [out] | cn | cn(x, k).
  [out] | dn | dn(x, k).

Returns
  the value of am(x, k)

Definition at line 416 of file EllipticFunction.cpp.

References am(), and Delta().

## ◆ sncndn()

void GeographicLib::EllipticFunction::sncndn | ( | real | x,
|  | real & | sn,
|  | real & | cn,
|  | real & | dn ) const

The Jacobi elliptic functions.

Parameters

  [in] | x | the argument.
  [out] | sn | sn(x, k).
  [out] | cn | cn(x, k).
  [out] | dn | dn(x, k).

For this routine k is restricted to the interval [0, 1].

Definition at line 315 of file EllipticFunction.cpp.

References GEOGRAPHICLIB_PANIC, and std::swap().

## ◆ Delta()

Math::real GeographicLib::EllipticFunction::Delta | ( | real | sn,
|  | real | cn ) const
| inline

The Δ amplitude function.

Parameters

  [in] | sn | sinφ.
  [in] | cn | cosφ.

Returns
  Δ = sqrt(1 − k2 sin2φ).

Definition at line 607 of file EllipticFunction.hpp.

Referenced by am(), D(), E(), Ed(), Einv(), F(), G(), H(), and Pi().

## ◆ RF() [1/2]

Math::real GeographicLib::EllipticFunction::RF | ( | real | x,
|  | real | y,
|  | real | z )
| static

Symmetric integral of the first kind RF.

Parameters

  [in] | x |
  [in] | y |
  [in] | z |

Returns
  RF(x, y, z).

RF is defined in https://dlmf.nist.gov/19.16.E1

\[ R_F(x, y, z) = \frac12 \int_0^\infty\frac1{\sqrt{(t + x) (t + y) (t + z)}}\, dt, \]

where at most one of arguments, x, y, z, can be zero and those arguments that are nonzero must be positive. If one of the arguments is zero, it is more efficient to call the two-argument version of this function with the non-zero arguments.

Definition at line 24 of file EllipticFunction.cpp.

Referenced by E(), F(), G(), H(), Pi(), GeographicLib::AuxLatitude::Rectifying(), Reset(), and RG().

## ◆ RF() [2/2]

Math::real GeographicLib::EllipticFunction::RF | ( | real | x,
|  | real | y )
| static

Complete symmetric integral of the first kind, RF with one argument zero.

Parameters

  [in] | x |
  [in] | y |

Returns
  RF(x, y, 0).

The arguments x and y must be positive.

Definition at line 61 of file EllipticFunction.cpp.

References GeographicLib::Math::pi(), and std::swap().

## ◆ RC()

Math::real GeographicLib::EllipticFunction::RC | ( | real | x,
|  | real | y )
| static

Degenerate symmetric integral of the first kind RC.

Parameters

  [in] | x |
  [in] | y |

Returns
  RC(x, y) = RF(x, y, y).

RC is defined in https://dlmf.nist.gov/19.2.E17

\[ R_C(x, y) = \frac12 \int_0^\infty\frac1{\sqrt{t + x}(t + y)}\,dt, \]

where x ≥ 0 and y > 0.

Definition at line 76 of file EllipticFunction.cpp.

Referenced by Reset(), and RJ().

## ◆ RG() [1/2]

Math::real GeographicLib::EllipticFunction::RG | ( | real | x,
|  | real | y,
|  | real | z )
| static

Symmetric integral of the second kind RG.

Parameters

  [in] | x |
  [in] | y |
  [in] | z |

Returns
  RG(x, y, z).

RG is defined in Carlson, eq 1.5

\[ R_G(x, y, z) = \frac14 \int_0^\infty[(t + x) (t + y) (t + z)]^{-1/2} \biggl( \frac x{t + x} + \frac y{t + y} + \frac z{t + z} \biggr)t\,dt, \]

where at most one of arguments, x, y, z, can be zero and those arguments that are nonzero must be positive. See also https://dlmf.nist.gov/19.23.E6_5. If one of the arguments is zero, it is more efficient to call the two-argument version of this function with the non-zero arguments.

Definition at line 91 of file EllipticFunction.cpp.

References RD(), RF(), and RG().

Referenced by GeographicLib::AuxLatitude::RectifyingRadius(), Reset(), and RG().

## ◆ RG() [2/2]

Math::real GeographicLib::EllipticFunction::RG | ( | real | x,
|  | real | y )
| static

Complete symmetric integral of the second kind, RG with one argument zero.

Parameters

  [in] | x |
  [in] | y |

Returns
  RG(x, y, 0).

The arguments x and y must be positive.

Definition at line 100 of file EllipticFunction.cpp.

References GeographicLib::Math::pi(), and GeographicLib::Math::sq().

## ◆ RJ()

Math::real GeographicLib::EllipticFunction::RJ | ( | real | x,
|  | real | y,
|  | real | z,
|  | real | p )
| static

Symmetric integral of the third kind RJ.

Parameters

  [in] | x |
  [in] | y |
  [in] | z |
  [in] | p |

Returns
  RJ(x, y, z, p).

RJ is defined in https://dlmf.nist.gov/19.16.E2

\[ R_J(x, y, z, p) = \frac32 \int_0^\infty [(t + x) (t + y) (t + z)]^{-1/2} (t + p)^{-1}\, dt, \]

where p > 0, and x, y, z are nonnegative with at most one of them being 0.

Definition at line 123 of file EllipticFunction.cpp.

References RC(), and GeographicLib::Math::sq().

Referenced by G(), H(), Pi(), and Reset().

## ◆ RD()

Math::real GeographicLib::EllipticFunction::RD | ( | real | x,
|  | real | y,
|  | real | z )
| static

Degenerate symmetric integral of the third kind RD.

Parameters

  [in] | x |
  [in] | y |
  [in] | z |

Returns
  RD(x, y, z) = RJ(x, y, z, z).

RD is defined in https://dlmf.nist.gov/19.16.E5

\[ R_D(x, y, z) = \frac32 \int_0^\infty[(t + x) (t + y)]^{-1/2} (t + z)^{-3/2}\, dt, \]

where x, y, z are positive except that at most one of x and y can be 0.

Definition at line 177 of file EllipticFunction.cpp.

Referenced by D(), E(), GeographicLib::AuxLatitude::Rectifying(), Reset(), and RG().

The documentation for this class was generated from the following files:

- EllipticFunction.hpp
- EllipticFunction.cpp