LuniSolarTerm.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.data;

  18. import org.hipparchus.CalculusFieldElement;

  19. /** Class for luni-solar only terms.
  20.  * @author Luc Maisonobe
  21.  */
  22. class LuniSolarTerm extends SeriesTerm {

  23.     /** Coefficient for mean anomaly of the Moon. */
  24.     private final int cL;

  25.     /** Coefficient for mean anomaly of the Sun. */
  26.     private final int cLPrime;

  27.     /** Coefficient for L - Ω where L is the mean longitude of the Moon. */
  28.     private final int cF;

  29.     /** Coefficient for mean elongation of the Moon from the Sun. */
  30.     private final int cD;

  31.     /** Coefficient for mean longitude of the ascending node of the Moon. */
  32.     private final int cOmega;

  33.     /** Build a luni-solar term for nutation series.
  34.      * @param cL coefficient for mean anomaly of the Moon
  35.      * @param cLPrime coefficient for mean anomaly of the Sun
  36.      * @param cF coefficient for L - Ω where L is the mean longitude of the Moon
  37.      * @param cD coefficient for mean elongation of the Moon from the Sun
  38.      * @param cOmega coefficient for mean longitude of the ascending node of the Moon
  39.      */
  40.     LuniSolarTerm(final int cL, final int cLPrime, final int cF, final int cD, final int cOmega) {
  41.         this.cL      = cL;
  42.         this.cLPrime = cLPrime;
  43.         this.cF      = cF;
  44.         this.cD      = cD;
  45.         this.cOmega  = cOmega;
  46.     }

  47.     /** {@inheritDoc} */
  48.     protected double argument(final BodiesElements elements) {
  49.         return cL * elements.getL() + cLPrime * elements.getLPrime() + cF * elements.getF() +
  50.                cD * elements.getD() + cOmega * elements.getOmega();
  51.     }

  52.     /** {@inheritDoc} */
  53.     protected double argumentDerivative(final BodiesElements elements) {
  54.         return cL * elements.getLDot() + cLPrime * elements.getLPrimeDot() + cF * elements.getFDot() +
  55.                cD * elements.getDDot() + cOmega * elements.getOmegaDot();
  56.     }

  57.     /** {@inheritDoc} */
  58.     protected <T extends CalculusFieldElement<T>> T argument(final FieldBodiesElements<T> elements) {
  59.         return elements.getL().multiply(cL).
  60.                add(elements.getLPrime().multiply(cLPrime)).
  61.                add(elements.getF().multiply(cF)).
  62.                add(elements.getD().multiply(cD)).
  63.                add(elements.getOmega().multiply(cOmega));
  64.     }

  65.     /** {@inheritDoc} */
  66.     protected <T extends CalculusFieldElement<T>> T argumentDerivative(final FieldBodiesElements<T> elements) {
  67.         return elements.getLDot().multiply(cL).
  68.                add(elements.getLPrimeDot().multiply(cLPrime)).
  69.                add(elements.getFDot().multiply(cF)).
  70.                add(elements.getDDot().multiply(cD)).
  71.                add(elements.getOmegaDot().multiply(cOmega));
  72.     }

  73. }