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  
19  import org.orekit.time.AbsoluteDate;
20  import org.orekit.time.DateComponents;
21  import org.orekit.time.TimeScale;
22  import org.orekit.utils.Constants;
23  
24  /**
25   * Set of useful physical CR3BP constants using JPL data.
26   * @author Vincent Mouraux
27   * @since 11.0
28   */
29  public class CR3BPConstants {
30  
31      /** Private constructor.
32       * <p>This class is a utility class, it should neither have a public
33       * nor a default constructor. This private constructor prevents
34       * the compiler from generating one automatically.</p>
35       */
36      private CR3BPConstants() {
37      }
38  
39      /**
40       * Get the Moon semi-major axis.
41       * @return the Moon semi-major axis in meters
42       */
43      public static double getMoonSemiMajorAxis() {
44          return 384400000.0;
45      }
46  
47      /**
48       * Get the Earth-Moon barycenter semi-major axis.
49       * @param date date
50       * @param timeScale time scale
51       * @return the Earth-Moon barycenter semi-major axis in meters
52       */
53      public static double getEarthMoonBarycenterSemiMajorAxis(final AbsoluteDate date,
54                                                               final TimeScale timeScale) {
55          // Century
56          final double century = getCentury(date, timeScale);
57          // Return the Earth - Moon barycenter semi-major axis
58          return  (1.00000261 + 0.00000562 * century) * Constants.IAU_2012_ASTRONOMICAL_UNIT;
59      }
60  
61      /**
62       * Get the Jupiter semi-major axis.
63       * @param date date
64       * @param timeScale time scale
65       * @return the Jupiter semi-major axis in meters
66       */
67      public static double getJupiterSemiMajorAxis(final AbsoluteDate date,
68                                                   final TimeScale timeScale) {
69          // Century
70          final double century = getCentury(date, timeScale);
71          // Return the Jupiter semi-major axis
72          return (5.20288700 - 0.00011607 * century) * Constants.IAU_2012_ASTRONOMICAL_UNIT;
73      }
74  
75      /**
76       * Get the current century as a floating value.
77       * @param date date
78       * @param timeScale time scale
79       * @return the current century as a floating value
80       */
81      private static double getCentury(final AbsoluteDate date,
82                                       final TimeScale timeScale) {
83          // Get the date component
84          final DateComponents dc = date.getComponents(timeScale).getDate();
85          // Return the current century as a floating value
86          return 0.01 * (dc.getYear() - 2000.0);
87      }
88  
89  }