PlanetaryTerm.java

  1. /* Copyright 2002-2024 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 planetary only terms.
  20.  * @author Luc Maisonobe
  21.  */
  22. class PlanetaryTerm extends SeriesTerm {

  23.     /** Coefficient for mean Mercury longitude. */
  24.     private final int cMe;

  25.     /** Coefficient for mean Venus longitude. */
  26.     private final int cVe;

  27.     /** Coefficient for mean Earth longitude. */
  28.     private final int cE;

  29.     /** Coefficient for mean Mars longitude. */
  30.     private final int cMa;

  31.     /** Coefficient for mean Jupiter longitude. */
  32.     private final int cJu;

  33.     /** Coefficient for mean Saturn longitude. */
  34.     private final int cSa;

  35.     /** Coefficient for mean Uranus longitude. */
  36.     private final int cUr;

  37.     /** Coefficient for mean Neptune longitude. */
  38.     private final int cNe;

  39.     /** Coefficient for general accumulated precession in longitude. */
  40.     private final int cPa;

  41.     /** Build a planetary term for nutation series.
  42.      * @param cMe coefficient for mean Mercury longitude
  43.      * @param cVe coefficient for mean Venus longitude
  44.      * @param cE coefficient for mean Earth longitude
  45.      * @param cMa coefficient for mean Mars longitude
  46.      * @param cJu coefficient for mean Jupiter longitude
  47.      * @param cSa coefficient for mean Saturn longitude
  48.      * @param cUr coefficient for mean Uranus longitude
  49.      * @param cNe coefficient for mean Neptune longitude
  50.      * @param cPa coefficient for general accumulated precession in longitude
  51.       */
  52.     PlanetaryTerm(final int cMe, final int cVe, final int cE, final int cMa, final int cJu,
  53.                   final int cSa, final int cUr, final int cNe, final int cPa) {
  54.         this.cMe = cMe;
  55.         this.cVe = cVe;
  56.         this.cE  = cE;
  57.         this.cMa = cMa;
  58.         this.cJu = cJu;
  59.         this.cSa = cSa;
  60.         this.cUr = cUr;
  61.         this.cNe = cNe;
  62.         this.cPa = cPa;
  63.     }

  64.     /** {@inheritDoc} */
  65.     protected double argument(final BodiesElements elements) {
  66.         return cMe * elements.getLMe() + cVe * elements.getLVe() + cE  * elements.getLE() +
  67.                cMa * elements.getLMa() + cJu * elements.getLJu() +
  68.                cSa * elements.getLSa() + cUr * elements.getLUr() +
  69.                cNe * elements.getLNe() + cPa * elements.getPa();
  70.     }

  71.     /** {@inheritDoc} */
  72.     protected double argumentDerivative(final BodiesElements elements) {
  73.         return cMe * elements.getLMeDot() + cVe * elements.getLVeDot() + cE  * elements.getLEDot() +
  74.                cMa * elements.getLMaDot() + cJu * elements.getLJuDot() +
  75.                cSa * elements.getLSaDot() + cUr * elements.getLUrDot() +
  76.                cNe * elements.getLNeDot() + cPa * elements.getPaDot();
  77.     }

  78.     /** {@inheritDoc} */
  79.     protected <T extends CalculusFieldElement<T>> T argument(final FieldBodiesElements<T> elements) {
  80.         return elements.getLMe().multiply(cMe).
  81.                add(elements.getLVe().multiply(cVe)).
  82.                add(elements.getLE().multiply(cE)).
  83.                add(elements.getLMa().multiply(cMa)).
  84.                add(elements.getLJu().multiply(cJu)).
  85.                add(elements.getLSa().multiply(cSa)).
  86.                add(elements.getLUr().multiply(cUr)).
  87.                add(elements.getLNe().multiply(cNe)).
  88.                add(elements.getPa().multiply(cPa));
  89.     }

  90.     /** {@inheritDoc} */
  91.     protected <T extends CalculusFieldElement<T>> T argumentDerivative(final FieldBodiesElements<T> elements) {
  92.         return elements.getLMeDot().multiply(cMe).
  93.                add(elements.getLVeDot().multiply(cVe)).
  94.                add(elements.getLEDot().multiply(cE)).
  95.                add(elements.getLMaDot().multiply(cMa)).
  96.                add(elements.getLJuDot().multiply(cJu)).
  97.                add(elements.getLSaDot().multiply(cSa)).
  98.                add(elements.getLUrDot().multiply(cUr)).
  99.                add(elements.getLNeDot().multiply(cNe)).
  100.                add(elements.getPaDot().multiply(cPa));
  101.     }

  102. }