NoFarPlanetsTerm.java

  1. /* Copyright 2002-2018 CS Systèmes d'Information
  2.  * Licensed to CS Systèmes d'Information (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.RealFieldElement;

  19. /** Class for terms that do not depend on far planets and some other elements.
  20.  * @param <T> the type of the field elements
  21.  * @author Luc Maisonobe
  22.  */
  23. class NoFarPlanetsTerm extends SeriesTerm {

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

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

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

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

  32.     /** Coefficient for mean Mercury longitude. */
  33.     private final int cMe;

  34.     /** Coefficient for mean Venus longitude. */
  35.     private final int cVe;

  36.     /** Coefficient for mean Earth longitude. */
  37.     private final int cE;

  38.     /** Coefficient for mean Mars longitude. */
  39.     private final int cMa;

  40.     /** Coefficient for mean Jupiter longitude. */
  41.     private final int cJu;

  42.     /** Coefficient for mean Saturn longitude. */
  43.     private final int cSa;

  44.     /** Build a planetary term for nutation series.
  45.      * @param cL coefficient for mean anomaly of the Moon
  46.      * @param cF coefficient for L - Ω where L is the mean longitude of the Moon
  47.      * @param cD coefficient for mean elongation of the Moon from the Sun
  48.      * @param cOmega coefficient for mean longitude of the ascending node of the Moon
  49.      * @param cMe coefficient for mean Mercury longitude
  50.      * @param cVe coefficient for mean Venus longitude
  51.      * @param cE coefficient for mean Earth longitude
  52.      * @param cMa coefficient for mean Mars longitude
  53.      * @param cJu coefficient for mean Jupiter longitude
  54.      * @param cSa coefficient for mean Saturn longitude
  55.      */
  56.     NoFarPlanetsTerm(final int cL, final int cF, final int cD, final int cOmega,
  57.                      final int cMe, final int cVe, final int cE, final int cMa,
  58.                      final int cJu, final int cSa) {
  59.         this.cL     = cL;
  60.         this.cF     = cF;
  61.         this.cD     = cD;
  62.         this.cOmega = cOmega;
  63.         this.cMe    = cMe;
  64.         this.cVe    = cVe;
  65.         this.cE     = cE;
  66.         this.cMa    = cMa;
  67.         this.cJu    = cJu;
  68.         this.cSa    = cSa;
  69.     }

  70.     /** {@inheritDoc} */
  71.     protected double argument(final BodiesElements elements) {
  72.         return cL * elements.getL() + cF * elements.getF() +
  73.                cD * elements.getD() + cOmega * elements.getOmega() +
  74.                cMe * elements.getLMe() + cVe * elements.getLVe() + cE  * elements.getLE() +
  75.                cMa * elements.getLMa() + cJu * elements.getLJu() + cSa * elements.getLSa();
  76.     }

  77.     /** {@inheritDoc} */
  78.     protected double argumentDerivative(final BodiesElements elements) {
  79.         return cL * elements.getLDot() + cF * elements.getFDot() +
  80.                cD * elements.getDDot() + cOmega * elements.getOmegaDot() +
  81.                cMe * elements.getLMeDot() + cVe * elements.getLVeDot() + cE  * elements.getLEDot() +
  82.                cMa * elements.getLMaDot() + cJu * elements.getLJuDot() + cSa * elements.getLSaDot();
  83.     }

  84.     /** {@inheritDoc} */
  85.     protected <T extends RealFieldElement<T>> T argument(final FieldBodiesElements<T> elements) {
  86.         return elements.getL().multiply(cL).
  87.                add(elements.getF().multiply(cF)).
  88.                add(elements.getD().multiply(cD)).
  89.                add(elements.getOmega().multiply(cOmega)).
  90.                add(elements.getLMe().multiply(cMe)).
  91.                add(elements.getLVe().multiply(cVe)).
  92.                add(elements.getLE().multiply(cE)).
  93.                add(elements.getLMa().multiply(cMa)).
  94.                add(elements.getLJu().multiply(cJu)).
  95.                add(elements.getLSa().multiply(cSa));
  96.     }

  97.     /** {@inheritDoc} */
  98.     protected <T extends RealFieldElement<T>> T argumentDerivative(final FieldBodiesElements<T> elements) {
  99.         return elements.getLDot().multiply(cL).
  100.                add(elements.getFDot().multiply(cF)).
  101.                add(elements.getDDot().multiply(cD)).
  102.                add(elements.getOmegaDot().multiply(cOmega)).
  103.                add(elements.getLMeDot().multiply(cMe)).
  104.                add(elements.getLVeDot().multiply(cVe)).
  105.                add(elements.getLEDot().multiply(cE)).
  106.                add(elements.getLMaDot().multiply(cMa)).
  107.                add(elements.getLJuDot().multiply(cJu)).
  108.                add(elements.getLSaDot().multiply(cSa));
  109.     }

  110. }