WarpTwin
Documentation for WarpTwin models and classes.
Loading...
Searching...
No Matches
sphericalharmonicsutils.h
Go to the documentation of this file.
1/******************************************************************************
2* Copyright (c) ATTX INC 2025. All Rights Reserved.
3*
4* This software and associated documentation (the "Software") are the
5* proprietary and confidential information of ATTX INC. The Software is
6* furnished under a license agreement between ATTX and the user organization
7* and may be used or copied only in accordance with the terms of the agreement.
8* Refer to 'license/attx_license.adoc' for standard license terms.
9*
10* EXPORT CONTROL NOTICE: THIS SOFTWARE MAY INCLUDE CONTENT CONTROLLED UNDER THE
11* INTERNATIONAL TRAFFIC IN ARMS REGULATIONS (ITAR) OR THE EXPORT ADMINISTRATION
12* REGULATIONS (EAR99). No part of the Software may be used, reproduced, or
13* transmitted in any form or by any means, for any purpose, without the express
14* written permission of ATTX INC.
15******************************************************************************/
16/* ADDITIONAL COPYRIGHT NOTICE
17 * The header accompanying the original file from which these functions are derived
18 is as follows: */
19/* This file is distributed with 42, */
20/* the (mostly harmless) spacecraft dynamics simulation */
21/* created by Eric Stoneking of NASA Goddard Space Flight Center */
22/* Copyright 2010 United States Government */
23/* as represented by the Administrator */
24/* of the National Aeronautics and Space Administration. */
25/* No copyright is claimed in the United States */
26/* under Title 17, U.S. Code. */
27/* All Other Rights Reserved. */
28#ifndef UTILS_SPHERICALHARMONICSUTILS_H
29#define UTILS_SPHERICALHARMONICSUTILS_H
30
31#include <string>
32
34#include "core/mathmacros.h"
35
36namespace warptwin {
37 // Constants for spherical harmonics
39
65 int readGravityCoefficientsFile(const std::string &filename,
68 long int &n, long int &m);
69
96
118 int sphericalHarmonics(long N, long M, double r, double phi,
119 double theta, double Re, double K,
122 CartesianVector3 &grad_v);
123
141 int legendre(long N, long M, double x,
144
156 double fact(long n);
157
169 double oddfact(long n);
170}
171
172#endif
#define CartesianVector3
Definition mathmacros.h:43
Class to propagate CR3BP dynamics in characteristic units.
Definition statistics.hpp:22
void neumannNormalization(double cbar[NMAX_SPHERICAL_HARMONICS+1][NMAX_SPHERICAL_HARMONICS+1], double sbar[NMAX_SPHERICAL_HARMONICS+1][NMAX_SPHERICAL_HARMONICS+1], double c[NMAX_SPHERICAL_HARMONICS+1][NMAX_SPHERICAL_HARMONICS+1], double s[NMAX_SPHERICAL_HARMONICS+1][NMAX_SPHERICAL_HARMONICS+1])
Applies Neumann normalization to spherical harmonic coefficients.
Definition sphericalharmonicsutils.cpp:58
const int NMAX_SPHERICAL_HARMONICS
Definition sphericalharmonicsutils.h:38
int sphericalHarmonics(long N, long M, double r, double phi, double theta, double Re, double K, double C[NMAX_SPHERICAL_HARMONICS+1][NMAX_SPHERICAL_HARMONICS+1], double S[NMAX_SPHERICAL_HARMONICS+1][NMAX_SPHERICAL_HARMONICS+1], clockwerk::CartesianVector< 3 > &grad_v)
Computes the gradient of the gravitational potential using spherical harmonics.
Definition sphericalharmonicsutils.cpp:76
double r
Definition AsphericalGravityModel.h:113
int readGravityCoefficientsFile(const std::string &filename, double cbar[NMAX_SPHERICAL_HARMONICS+1][NMAX_SPHERICAL_HARMONICS+1], double sbar[NMAX_SPHERICAL_HARMONICS+1][NMAX_SPHERICAL_HARMONICS+1], long int &n, long int &m)
Reads gravitational coefficients from a file and stores them in provided matrices.
Definition sphericalharmonicsutils.cpp:37
double fact(long n)
Computes the factorial of a non-negative integer.
Definition sphericalharmonicsutils.cpp:183
int legendre(long N, long M, double x, double P[NMAX_SPHERICAL_HARMONICS+1][NMAX_SPHERICAL_HARMONICS+1], double sd_p[NMAX_SPHERICAL_HARMONICS+1][NMAX_SPHERICAL_HARMONICS+1])
Calculates the associated Legendre functions and their derivatives.
Definition sphericalharmonicsutils.cpp:139
double oddfact(long n)
Computes the double factorial of an odd integer.
Definition sphericalharmonicsutils.cpp:192