MeanTheory.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.propagation.conversion.osc2mean;

  18. import org.hipparchus.CalculusFieldElement;
  19. import org.orekit.orbits.FieldOrbit;
  20. import org.orekit.orbits.Orbit;

  21. /**
  22.  * Interface for theories that convert osculating into mean orbit.
  23.  *
  24.  * @author Pascal Parraud
  25.  * @since 13.0
  26.  */
  27. public interface MeanTheory {

  28.     /** Gets the name of the theory used for osculating to mean conversion.
  29.      * @return the actual theory
  30.      */
  31.     String getTheoryName();

  32.     /** Gets reference radius of the central body (m).
  33.      * @return reference radius of the central body
  34.      */
  35.     double getReferenceRadius();

  36.     /** Pre-treatment of the osculating orbit to be converted.
  37.      * <p>By default, no pre-treatment is applied to the osculating orbit.</p>
  38.      * @param osculating the osculating orbit to be treated
  39.      * @return preprocessed osculating orbit
  40.      */
  41.     default Orbit preprocessing(Orbit osculating) {
  42.         return osculating;
  43.     }

  44.     /** Rough initialization of the mean orbit.
  45.      * <p>By default, the mean orbit is initialized with the osculating orbit.</p>
  46.      * @param osculating the osculating orbit
  47.      * @return initial mean orbit
  48.      */
  49.     default Orbit initialize(Orbit osculating) {
  50.         return osculating;
  51.     }

  52.     /** Gets osculating orbit from mean orbit.
  53.      * @param mean mean orbit
  54.      * @return osculating orbit
  55.      */
  56.     Orbit meanToOsculating(Orbit mean);

  57.     /** Post-treatment of the converted mean orbit.
  58.      * <p>By default, the mean orbit returned is of the same
  59.      * type as the osculating orbit to be converted.</p>
  60.      * @param osculating the osculating orbit to be converted
  61.      * @param mean the converted mean orbit
  62.      * @return postprocessed mean orbit
  63.      */
  64.     default Orbit postprocessing(Orbit osculating, Orbit mean) {
  65.         return osculating.getType().convertType(mean);
  66.     }

  67.     /** Pre-treatment of the osculating orbit to be converted.
  68.      * <p>By default, no pre-treatment is applied to the osculating orbit.</p>
  69.      * @param <T> type of the field elements
  70.      * @param osculating the osculating orbit to be treated
  71.      * @return preprocessed osculating orbit
  72.      */
  73.     default <T extends CalculusFieldElement<T>> FieldOrbit<T> preprocessing(FieldOrbit<T> osculating) {
  74.         return osculating;
  75.     }

  76.     /** Rough initialization of the mean orbit.
  77.      * <p>By default, the mean orbit is initialized with the osculating orbit.</p>
  78.      * @param <T> type of the field elements
  79.      * @param osculating the osculating orbit
  80.      * @return initial mean orbit
  81.      */
  82.     default <T extends CalculusFieldElement<T>> FieldOrbit<T> initialize(FieldOrbit<T> osculating) {
  83.         return osculating;
  84.     }

  85.     /** Gets osculating orbit from mean orbit.
  86.      * @param <T> type of the field elements
  87.      * @param mean mean orbit
  88.      * @return osculating orbit
  89.      */
  90.     <T extends CalculusFieldElement<T>> FieldOrbit<T> meanToOsculating(FieldOrbit<T> mean);

  91.     /** Post-treatment of the converted mean orbit.
  92.      * <p>By default, the mean orbit returned is of the same
  93.      * type as the osculating orbit to be converted.</p>
  94.      * @param <T> type of the field elements
  95.      * @param osculating the osculating orbit to be converted
  96.      * @param mean the converted mean orbit
  97.      * @return postprocessed mean orbit
  98.      */
  99.     default <T extends CalculusFieldElement<T>> FieldOrbit<T> postprocessing(FieldOrbit<T> osculating,
  100.                                                                              FieldOrbit<T> mean) {
  101.         return osculating.getType().convertType(mean);
  102.     }

  103. }