1 /* 2 * - - - - - - - - - - 3 * g a l _ s t g e t 4 * - - - - - - - - - - 5 * 6 * This routine is part of the General Astrodynamics Library 7 * 8 * Description: 9 * 10 * This routine gets spherical terms C & S of degree n and order m 11 * from the given gravity model 12 * 13 * Status: 14 * 15 * support routine. 16 * 17 * Given: 18 * 19 * n i required degree 20 * m i required order 21 * *gm gal_gm_t pointer to gravity model structure 22 * 23 * Returned: 24 * 25 * *c d C coefficient 26 * *s d S coefficient 27 * gal_stget i 0 = success 28 * 1 = degree or order out of range 29 * 30 * Notes: 31 * 32 * 1) Gravitational coefficients C, S are efficiently stored in a single array CS. The lower 33 * triangle matrix CS holds the non-sectorial C coefficients C[n][m] ( n != m ). Sectorial C 34 * coefficients C[n][n] are the diagonal elements of CS and the upper triangular matrix 35 * stores the S[n][m] ( m != 0 ) coefficients in columns, for the same degree n. Mapping of 36 * CS to C, S is achieved through C[n][m] = CS[n][m], S[n][m] = CS[m-1][n]. 37 * 38 * This revision: 39 * 40 * 2008 March 22 41 * 42 * Copyright (C) 2008 Paul C. L. Willmott. See notes at end. 43 * 44 *----------------------------------------------------------------------- 45 */ 46 47 #ifndef _GAL_STGET_H_ 48 #define _GAL_STGET_H_ 1 49 50 #include "gal_gm.h" 51 52 #undef __BEGIN_DECLS 53 #undef __END_DECLS 54 #ifdef __cplusplus 55 #define __BEGIN_DECLS extern "C" { 56 #define __END_DECLS } 57 #else 58 #define __BEGIN_DECLS /* empty */ 59 #define __END_DECLS /* empty */ 60 #endif 61 62 __BEGIN_DECLS 63 64 int 65 gal_stget 66 ( 67 const int n, 68 const int m, 69 gal_gm_t *gm, 70 double *c, 71 double *s 72 ) ; 73 74 __END_DECLS 75 76 #endif /* !_GAL_STGET_ */ 77 78 /* 79 * gal - General Astrodynamics Library 80 * Copyright (C) 2008 Paul C. L. Willmott 81 * 82 * This program is free software; you can redistribute it and/or modify 83 * it under the terms of the GNU General Public License as published by 84 * the Free Software Foundation; either version 2 of the License, or 85 * (at your option) any later version. 86 * 87 * This program is distributed in the hope that it will be useful, 88 * but WITHOUT ANY WARRANTY; without even the implied warranty of 89 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 90 * GNU General Public License for more details. 91 * 92 * You should have received a copy of the GNU General Public License along 93 * with this program; if not, write to the Free Software Foundation, Inc., 94 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 95 * 96 * Contact: 97 * 98 * Paul Willmott 99 * vp9mu@amsat.org 100 */ 101 102