CR3BPConstants.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.numerical.cr3bp;

  18. import org.orekit.time.AbsoluteDate;
  19. import org.orekit.time.DateComponents;
  20. import org.orekit.time.TimeScale;
  21. import org.orekit.utils.Constants;

  22. /**
  23.  * Set of useful physical CR3BP constants using JPL data.
  24.  * @author Vincent Mouraux
  25.  * @since 11.0
  26.  */
  27. public class CR3BPConstants {

  28.     /** Private constructor.
  29.      * <p>This class is a utility class, it should neither have a public
  30.      * nor a default constructor. This private constructor prevents
  31.      * the compiler from generating one automatically.</p>
  32.      */
  33.     private CR3BPConstants() {
  34.     }

  35.     /**
  36.      * Get the Moon semi-major axis.
  37.      * @return the Moon semi-major axis in meters
  38.      */
  39.     public static double getMoonSemiMajorAxis() {
  40.         return 384400000.0;
  41.     }

  42.     /**
  43.      * Get the Earth-Moon barycenter semi-major axis.
  44.      * @param date date
  45.      * @param timeScale time scale
  46.      * @return the Earth-Moon barycenter semi-major axis in meters
  47.      */
  48.     public static double getEarthMoonBarycenterSemiMajorAxis(final AbsoluteDate date,
  49.                                                              final TimeScale timeScale) {
  50.         // Century
  51.         final double century = getCentury(date, timeScale);
  52.         // Return the Earth - Moon barycenter semi-major axis
  53.         return  (1.00000261 + 0.00000562 * century) * Constants.IAU_2012_ASTRONOMICAL_UNIT;
  54.     }

  55.     /**
  56.      * Get the Jupiter semi-major axis.
  57.      * @param date date
  58.      * @param timeScale time scale
  59.      * @return the Jupiter semi-major axis in meters
  60.      */
  61.     public static double getJupiterSemiMajorAxis(final AbsoluteDate date,
  62.                                                  final TimeScale timeScale) {
  63.         // Century
  64.         final double century = getCentury(date, timeScale);
  65.         // Return the Jupiter semi-major axis
  66.         return (5.20288700 - 0.00011607 * century) * Constants.IAU_2012_ASTRONOMICAL_UNIT;
  67.     }

  68.     /**
  69.      * Get the current century as a floating value.
  70.      * @param date date
  71.      * @param timeScale time scale
  72.      * @return the current century as a floating value
  73.      */
  74.     private static double getCentury(final AbsoluteDate date,
  75.                                      final TimeScale timeScale) {
  76.         // Get the date component
  77.         final DateComponents dc = date.getComponents(timeScale).getDate();
  78.         // Return the current century as a floating value
  79.         return 0.01 * (dc.getYear() - 2000.0);
  80.     }

  81. }