Tudat/Mathematics/BasicMathematics/sphericalHarmonics.cpp
//! Compute the gradient of a single term of a spherical harmonics potential field.
Compute the gradient of a single term of a spherical harmonics potential field.
Compute the gradient of a single term of a spherical harmonics potential field .
Eigen::Vector3d computePotentialGradient(
        const Eigen::Vector3d& sphericalPosition,
        const double referenceRadius,
        const double preMultiplier,
        const int degree,
        const int order,
        const double cosineHarmonicCoefficient,
        const double sineHarmonicCoefficient,
        const double legendrePolynomial,
        const double legendrePolynomialDerivative )
{
    return computePotentialGradient(
                sphericalPosition( radiusIndex ),
                basic_mathematics::raiseToIntegerPower
                ( referenceRadius / sphericalPosition( radiusIndex ), static_cast< double >( degree ) + 1.0 ),
                std::cos( static_cast< double >( order ) * sphericalPosition( longitudeIndex ) ),
                std::sin( static_cast< double >( order ) * sphericalPosition( longitudeIndex ) ),
                std::cos( sphericalPosition( latitudeIndex ) ), preMultiplier, degree, order,
                cosineHarmonicCoefficient, sineHarmonicCoefficient, legendrePolynomial,legendrePolynomialDerivative );
}
Eigen :: Vector3d computePotentialGradient ( const Eigen :: Vector3d & sphericalPosition , const double referenceRadius , const double preMultiplier , const int degree , const int order , const double cosineHarmonicCoefficient , const double sineHarmonicCoefficient , const double legendrePolynomial , const double legendrePolynomialDerivative ) { return computePotentialGradient ( sphericalPosition ( radiusIndex ) , basic_mathematics :: raiseToIntegerPower ( referenceRadius / sphericalPosition ( radiusIndex ) , static_cast < double > ( degree ) + 1.0 ) , std :: cos ( static_cast < double > ( order ) * sphericalPosition ( longitudeIndex ) ) , std :: sin ( static_cast < double > ( order ) * sphericalPosition ( longitudeIndex ) ) , std :: cos ( sphericalPosition ( latitudeIndex ) ) , preMultiplier , degree , order , cosineHarmonicCoefficient , sineHarmonicCoefficient , legendrePolynomial , legendrePolynomialDerivative ) ; }
Compute the gradient of a single term of a spherical harmonics potential field.
Compute the gradient of a single term of a spherical harmonics potential field .