InertiaAxis.java

  1. /* Copyright 2022-2025 Luc Maisonobe
  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.attitudes;

  18. import org.hipparchus.geometry.euclidean.threed.Vector3D;

  19. /** Container for inertial axis.
  20.  * <p>
  21.  * Instances of this class are immutable
  22.  * </p>
  23.  * @author Luc Maisonobe
  24.  * @since 12.0
  25.  */
  26. public class InertiaAxis {

  27.     /** Moment of inertia. */
  28.     private final double i;

  29.     /** Inertia axis. */
  30.     private final Vector3D a;

  31.     /** Simple constructor to pair a moment of inertia with its associated axis.
  32.      * @param i moment of inertia
  33.      * @param a inertia axis
  34.      */
  35.     public InertiaAxis(final double i, final Vector3D a) {
  36.         this.i = i;
  37.         this.a = a;
  38.     }

  39.     /** Reverse the inertia axis.
  40.      * @return new container with reversed axis
  41.      */
  42.     public InertiaAxis negate() {
  43.         return new InertiaAxis(i, a.negate());
  44.     }

  45.     /** Get the moment of inertia.
  46.      * @return moment of inertia
  47.      */
  48.     public double getI() {
  49.         return i;
  50.     }

  51.     /** Get the inertia axis.
  52.      * @return inertia axis
  53.      */
  54.     public Vector3D getA() {
  55.         return a;
  56.     }

  57. }