GeographicLib 2.1.2
|
Spherical harmonic sums for a circle. More...
#include <GeographicLib/CircularEngine.hpp>
Public Member Functions | |
CircularEngine () | |
Math::real | operator() (real sinlon, real coslon) const |
Math::real | operator() (real lon) const |
Math::real | operator() (real sinlon, real coslon, real &gradx, real &grady, real &gradz) const |
Math::real | operator() (real lon, real &gradx, real &grady, real &gradz) const |
Friends | |
class | SphericalEngine |
Spherical harmonic sums for a circle.
The class is a companion to SphericalEngine. If the results of a spherical harmonic sum are needed for several points on a circle of constant latitude lat and height h, then SphericalEngine::Circle can compute the inner sum, which is independent of longitude lon, and produce a CircularEngine object. CircularEngine::operator()() can then be used to perform the outer sum for particular vales of lon. This can lead to substantial improvements in computational speed for high degree sum (approximately by a factor of N / 2 where N is the maximum degree).
CircularEngine is tightly linked to the internals of SphericalEngine. For that reason, the constructor for this class is private. Use SphericalHarmonic::Circle, SphericalHarmonic1::Circle, and SphericalHarmonic2::Circle to create instances of this class.
CircularEngine stores the coefficients needed to allow the summation over order to be performed in 2 or 6 vectors of length M + 1 (depending on whether gradients are to be calculated). For this reason the constructor may throw a std::bad_alloc exception.
Example of use:
Definition at line 52 of file CircularEngine.hpp.
|
inline |
A default constructor. CircularEngine::operator()() on the resulting object returns zero. The resulting object can be assigned to the result of SphericalHarmonic::Circle.
Definition at line 110 of file CircularEngine.hpp.
|
inline |
Evaluate the sum for a particular longitude given in terms of its sine and cosine.
[in] | sinlon | the sine of the longitude. |
[in] | coslon | the cosine of the longitude. |
The arguments must satisfy sinlon2 + coslon2 = 1.
Definition at line 128 of file CircularEngine.hpp.
|
inline |
Evaluate the sum for a particular longitude.
[in] | lon | the longitude (degrees). |
Definition at line 139 of file CircularEngine.hpp.
References GeographicLib::Math::sincosd().
|
inline |
Evaluate the sum and its gradient for a particular longitude given in terms of its sine and cosine.
[in] | sinlon | the sine of the longitude. |
[in] | coslon | the cosine of the longitude. |
[out] | gradx | x component of the gradient. |
[out] | grady | y component of the gradient. |
[out] | gradz | z component of the gradient. |
The gradients will only be computed if the CircularEngine object was created with this capability (e.g., via gradp = true in SphericalHarmonic::Circle). If not, gradx, etc., will not be touched. The arguments must satisfy sinlon2 + coslon2 = 1.
Definition at line 162 of file CircularEngine.hpp.
|
inline |
Evaluate the sum and its gradient for a particular longitude.
[in] | lon | the longitude (degrees). |
[out] | gradx | x component of the gradient. |
[out] | grady | y component of the gradient. |
[out] | gradz | z component of the gradient. |
The gradients will only be computed if the CircularEngine object was created with this capability (e.g., via gradp = true in SphericalHarmonic::Circle). If not, gradx, etc., will not be touched.
Definition at line 181 of file CircularEngine.hpp.
References GeographicLib::Math::sincosd().
|
friend |
Definition at line 69 of file CircularEngine.hpp.