EncounterLOFType.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.frames.encounter;

  18. import org.hipparchus.CalculusFieldElement;
  19. import org.orekit.utils.FieldPVCoordinates;
  20. import org.orekit.utils.PVCoordinates;

  21. /**
  22.  * Enum for encounter local orbital frame.
  23.  *
  24.  * @author Vincent Cucchietti
  25.  * @since 12.0
  26.  */
  27. public enum EncounterLOFType {

  28.     /**
  29.      * Default encounter local orbital frame based on Figure 1.3 from Romain Serra's thesis.
  30.      * <p>
  31.      * Note that <b>it is up to the user</b> to choose which object should be at the origin.
  32.      */
  33.     DEFAULT {
  34.         /** {@inheritDoc} */
  35.         @Override
  36.         public DefaultEncounterLOF getFrame(final PVCoordinates other) {
  37.             return new DefaultEncounterLOF(other);
  38.         }

  39.         /** {@inheritDoc} */
  40.         @Override
  41.         public <T extends CalculusFieldElement<T>> EncounterLOF getFrame(
  42.                 final FieldPVCoordinates<T> other) {
  43.             return new DefaultEncounterLOF(other);
  44.         }

  45.     },
  46.     /**
  47.      * Valsecchi encounter local orbital frame based on Valsecchi formulation from : "Valsecchi, G. B., Milani, A., Gronchi,
  48.      * G. F. &amp; Ches- ley, S. R. Resonant returns to close approaches: Analytical theory. Astronomy &amp; Astrophysics
  49.      * 408, 1179–1196 (2003)."
  50.      * <p>
  51.      * Note that <b>it is up to the user</b> to choose which object should be at the origin.
  52.      */
  53.     VALSECCHI {
  54.         /** {@inheritDoc} */
  55.         @Override
  56.         public ValsecchiEncounterFrame getFrame(final PVCoordinates other) {
  57.             return new ValsecchiEncounterFrame(other);
  58.         }

  59.         /** {@inheritDoc} */
  60.         @Override
  61.         public <T extends CalculusFieldElement<T>> EncounterLOF getFrame(
  62.                 final FieldPVCoordinates<T> other) {
  63.             return new ValsecchiEncounterFrame(other);
  64.         }

  65.     };

  66.     /**
  67.      * Get encounter local orbital frame associated to this enum.
  68.      *
  69.      * @param other other object {@link PVCoordinates position and velocity coordinates} that is not the origin of the
  70.      * encounter frame
  71.      *
  72.      * @return encounter local orbital frame associated to this enum
  73.      */
  74.     public abstract EncounterLOF getFrame(PVCoordinates other);

  75.     /**
  76.      * Get encounter local orbital frame associated to this enum.
  77.      *
  78.      * @param other other object {@link PVCoordinates position and velocity coordinates} that is not the origin of the
  79.      * encounter frame
  80.      * @param <T> type of the field elements
  81.      *
  82.      * @return encounter local orbital frame associated to this enum
  83.      */
  84.     public abstract <T extends CalculusFieldElement<T>> EncounterLOF getFrame(FieldPVCoordinates<T> other);
  85. }