GeographicLib  1.21
Public Member Functions
GeographicLib::EllipticFunction Class Reference

Elliptic functions needed for TransverseMercatorExact. More...

#include <GeographicLib/EllipticFunction.hpp>

List of all members.

Public Member Functions

 EllipticFunction (real m) throw ()
Math::real m () const throw ()
Math::real m1 () const throw ()
Math::real K () const throw ()
Math::real E () const throw ()
Math::real KE () const throw ()
void sncndn (real x, real &sn, real &cn, real &dn) const throw ()
Math::real E (real phi) const throw ()
Math::real E (real sn, real cn, real dn) const throw ()

Detailed Description

Elliptic functions needed for TransverseMercatorExact.

This provides the subset of elliptic functions needed for TransverseMercatorExact. For a given ellipsoid, only parameters e2 and 1 - e2 are needed. This class taken the parameter as a constructor parameters and caches the values of the required complete integrals. A method is provided for Jacobi elliptic functions and for the incomplete elliptic integral of the second kind in terms of the amplitude.

The computation of the elliptic integrals uses the algorithms given in

The computation of the Jacobi elliptic functions uses the algorithm given in

The notation follows Abramowitz and Stegun, Chapters 16 and 17.

Example of use:

// Example of using the GeographicLib::EllipticFunction class
// $Id: 304e818254ce2fd366c2efa4f7ef93643e8c208c $

#include <iostream>
#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 * Math::degree();
    // See Abramowitz and Stegun, table 17.6 with
    // alpha = asin(sqrt(m)) = 18.43 deg and phi = 20 deg
    cout << ell.E(phi) << " "
         << ell.E(sin(phi), cos(phi), sqrt(1 - ell.m() * Math::sq(sin(phi))))
         << "\n";
  }
  catch (const GeographicErr& e) {
    cout << "Caught exception: " << e.what() << "\n";
  }
  return 0;
}

Constructor & Destructor Documentation

GeographicLib::EllipticFunction::EllipticFunction ( real  m) throw () [explicit]

Constructor.

Parameters:
[in]mthe parameter which must lie in [0, 1]. (No checking is done.)

Definition at line 125 of file EllipticFunction.cpp.


Member Function Documentation

Math::real GeographicLib::EllipticFunction::m ( ) const throw () [inline]
Returns:
the parameter m.

Definition at line 76 of file EllipticFunction.hpp.

Math::real GeographicLib::EllipticFunction::m1 ( ) const throw () [inline]
Returns:
the complementary parameter m' = (1 - m).

Definition at line 81 of file EllipticFunction.hpp.

Math::real GeographicLib::EllipticFunction::K ( ) const throw () [inline]
Returns:
the complete integral of first kind, K(m).

Definition at line 86 of file EllipticFunction.hpp.

Math::real GeographicLib::EllipticFunction::E ( ) const throw () [inline]
Returns:
the complete integral of second kind, E(m).

Definition at line 91 of file EllipticFunction.hpp.

Math::real GeographicLib::EllipticFunction::KE ( ) const throw () [inline]
Returns:
the difference K(m) - E(m) (which can be computed directly).

Definition at line 97 of file EllipticFunction.hpp.

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

The Jacobi elliptic functions.

Parameters:
[in]xthe argument.
[out]snsn(x|m).
[out]cncn(x|m).
[out]dndn(x|m).

Definition at line 151 of file EllipticFunction.cpp.

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

The incomplete integral of the second kind.

Parameters:
[in]phi
Returns:
int sqrt(1 - m sin2(phi)) dphi.

Definition at line 213 of file EllipticFunction.cpp.

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

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

Parameters:
[in]sn
[in]cn
[in]dn
Returns:
int dn(w)2 dw (A+S 17.2.10).

Instead of specifying the amplitude phi, we provide sn = sin(phi), cn = cos(phi), dn = sqrt(1 - m sin2(phi)).

Definition at line 198 of file EllipticFunction.cpp.


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