FieldTrackingCoordinates.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.utils;

  18. import org.hipparchus.CalculusFieldElement;
  19. import org.hipparchus.Field;

  20. /** Container for azimut/elevation/range coordinates as seen from a ground point.
  21.  * @param <T> the type of the field elements
  22.  * @see org.orekit.frames.TopocentricFrame
  23.  * @since 12.0
  24.  */
  25. public class FieldTrackingCoordinates<T extends CalculusFieldElement<T>> {

  26.     /** Azimuth. */
  27.     private final T azimuth;

  28.     /** Elevation. */
  29.     private final T elevation;

  30.     /** Range. */
  31.     private final T range;

  32.     /** Simple constructor.
  33.      * @param azimuth azimuth
  34.      * @param elevation elevation
  35.      * @param range range
  36.      */
  37.     public FieldTrackingCoordinates(final T azimuth, final T elevation, final T range) {
  38.         this.azimuth   = azimuth;
  39.         this.elevation = elevation;
  40.         this.range     = range;
  41.     }

  42.     /** Build a new instance from a {@link TrackingCoordinates}.
  43.      * @param field field to which the elements belong
  44.      * @param trackingCoordinates tracking coordinates to convert
  45.      * @since 12.1
  46.      */
  47.     public FieldTrackingCoordinates(final Field<T> field, final TrackingCoordinates trackingCoordinates) {
  48.         this(field.getZero().newInstance(trackingCoordinates.getAzimuth()),
  49.              field.getZero().newInstance(trackingCoordinates.getElevation()),
  50.              field.getZero().newInstance(trackingCoordinates.getRange()));
  51.     }

  52.     /** Get the azimuth.
  53.      * <p>The azimuth is the angle between the North direction at local point and
  54.      * the projection in local horizontal plane of the direction from local point
  55.      * to given point. Azimuth angles are counted clockwise, i.e positive towards the East.</p>
  56.      * @return azimuth
  57.      */
  58.     public T getAzimuth() {
  59.         return azimuth;
  60.     }

  61.     /** Get the elevation.
  62.      * <p>The elevation is the angle between the local horizontal and
  63.      * the direction from local point to given point.</p>
  64.      * @return elevation
  65.      */
  66.     public T getElevation() {
  67.         return elevation;
  68.     }

  69.     /** Get the range.
  70.      * @return range
  71.      */
  72.     public T getRange() {
  73.         return range;
  74.     }

  75. }