GeographicLib
1.21
|
Elliptic functions needed for TransverseMercatorExact. More...
#include <GeographicLib/EllipticFunction.hpp>
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 () |
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; }
GeographicLib::EllipticFunction::EllipticFunction | ( | real | m | ) | throw () [explicit] |
Constructor.
[in] | m | the parameter which must lie in [0, 1]. (No checking is done.) |
Definition at line 125 of file EllipticFunction.cpp.
Math::real GeographicLib::EllipticFunction::m | ( | ) | const throw () [inline] |
Definition at line 76 of file EllipticFunction.hpp.
Math::real GeographicLib::EllipticFunction::m1 | ( | ) | const throw () [inline] |
Definition at line 81 of file EllipticFunction.hpp.
Math::real GeographicLib::EllipticFunction::K | ( | ) | const throw () [inline] |
Definition at line 86 of file EllipticFunction.hpp.
Math::real GeographicLib::EllipticFunction::E | ( | ) | const throw () [inline] |
Definition at line 91 of file EllipticFunction.hpp.
Math::real GeographicLib::EllipticFunction::KE | ( | ) | const throw () [inline] |
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.
[in] | x | the argument. |
[out] | sn | sn(x|m). |
[out] | cn | cn(x|m). |
[out] | dn | dn(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.
[in] | phi |
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
[in] | sn | |
[in] | cn | |
[in] | dn |
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.