1   /* Copyright 2002-2025 CS GROUP
2    * Licensed to CS GROUP (CS) under one or more
3    * contributor license agreements.  See the NOTICE file distributed with
4    * this work for additional information regarding copyright ownership.
5    * CS licenses this file to You under the Apache License, Version 2.0
6    * (the "License"); you may not use this file except in compliance with
7    * the License.  You may obtain a copy of the License at
8    *
9    *   http://www.apache.org/licenses/LICENSE-2.0
10   *
11   * Unless required by applicable law or agreed to in writing, software
12   * distributed under the License is distributed on an "AS IS" BASIS,
13   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14   * See the License for the specific language governing permissions and
15   * limitations under the License.
16   */
17  package org.orekit.forces.gravity.potential;
18  
19  import org.orekit.time.AbsoluteDate;
20  import org.orekit.time.TimeStamped;
21  
22  /**
23   * Interface used to provide un-normalized spherical harmonics coefficients.
24   * <p>
25   * Un-normalized spherical harmonics coefficients are fine for small degrees. At high
26   * degree and order the un-normalized coefficients are not representable in a {@code
27   * double}. {@link NormalizedSphericalHarmonicsProvider} is recommended for high precision
28   * applications.
29   *
30   * @author Luc Maisonobe
31   * @see GravityFields
32   * @since 6.0
33   */
34  public interface UnnormalizedSphericalHarmonicsProvider extends SphericalHarmonicsProvider {
35  
36      /**
37       * Un-normalized spherical harmonics coefficients evaluated at a specific instant.
38       * @see #onDate(AbsoluteDate)
39       * @since 6.1
40       */
41      interface UnnormalizedSphericalHarmonics extends TimeStamped {
42  
43          /** Get a spherical harmonic cosine coefficient.
44           * @param n degree of the coefficient
45           * @param m order of the coefficient
46           * @return un-normalized coefficient Cnm
47           */
48          double getUnnormalizedCnm(int n, int m);
49  
50          /** Get a spherical harmonic sine coefficient.
51           * @param n degree of the coefficient
52           * @param m order of the coefficient
53           * @return un-normalized coefficient Snm
54           */
55          double getUnnormalizedSnm(int n, int m);
56  
57      }
58  
59      /**
60       * Get the un-normalized spherical harmonic coefficients at a specific instance in time.
61       *
62       * @param date of evaluation (may be null if model is not time-dependent)
63       * @return un-normalized coefficients on {@code date}.
64       * @since 6.1
65       */
66      UnnormalizedSphericalHarmonics onDate(AbsoluteDate date);
67  
68      /**
69       * Get the un-normalized coefficient of degree 2 and order 0 at a specific instance in time.
70       *
71       * @param date of evaluation (may be null if model is not time-dependent)
72       * @return un-normalized C20 on {@code date}.
73       * @since 12.1
74       */
75      default double getUnnormalizedC20(final AbsoluteDate date) {
76          return onDate(date).getUnnormalizedCnm(2, 0);
77      }
78  
79  }