UnnormalizedSphericalHarmonicsProvider.java

  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. import org.orekit.time.AbsoluteDate;
  19. import org.orekit.time.TimeStamped;

  20. /**
  21.  * Interface used to provide un-normalized spherical harmonics coefficients.
  22.  * <p>
  23.  * Un-normalized spherical harmonics coefficients are fine for small degrees. At high
  24.  * degree and order the un-normalized coefficients are not representable in a {@code
  25.  * double}. {@link NormalizedSphericalHarmonicsProvider} is recommended for high precision
  26.  * applications.
  27.  *
  28.  * @author Luc Maisonobe
  29.  * @see GravityFields
  30.  * @since 6.0
  31.  */
  32. public interface UnnormalizedSphericalHarmonicsProvider extends SphericalHarmonicsProvider {

  33.     /**
  34.      * Un-normalized spherical harmonics coefficients evaluated at a specific instant.
  35.      * @see #onDate(AbsoluteDate)
  36.      * @since 6.1
  37.      */
  38.     interface UnnormalizedSphericalHarmonics extends TimeStamped {

  39.         /** Get a spherical harmonic cosine coefficient.
  40.          * @param n degree of the coefficient
  41.          * @param m order of the coefficient
  42.          * @return un-normalized coefficient Cnm
  43.          */
  44.         double getUnnormalizedCnm(int n, int m);

  45.         /** Get a spherical harmonic sine coefficient.
  46.          * @param n degree of the coefficient
  47.          * @param m order of the coefficient
  48.          * @return un-normalized coefficient Snm
  49.          */
  50.         double getUnnormalizedSnm(int n, int m);

  51.     }

  52.     /**
  53.      * Get the un-normalized spherical harmonic coefficients at a specific instance in time.
  54.      *
  55.      * @param date of evaluation (may be null if model is not time-dependent)
  56.      * @return un-normalized coefficients on {@code date}.
  57.      * @since 6.1
  58.      */
  59.     UnnormalizedSphericalHarmonics onDate(AbsoluteDate date);

  60.     /**
  61.      * Get the un-normalized coefficient of degree 2 and order 0 at a specific instance in time.
  62.      *
  63.      * @param date of evaluation (may be null if model is not time-dependent)
  64.      * @return un-normalized C20 on {@code date}.
  65.      * @since 12.1
  66.      */
  67.     default double getUnnormalizedC20(final AbsoluteDate date) {
  68.         return onDate(date).getUnnormalizedCnm(2, 0);
  69.     }

  70. }