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  
19  import org.hipparchus.CalculusFieldElement;
20  import org.hipparchus.Field;
21  
22  /** Container for azimut/elevation/range coordinates as seen from a ground point.
23   * @param <T> the type of the field elements
24   * @see org.orekit.frames.TopocentricFrame
25   * @since 12.0
26   */
27  public class FieldTrackingCoordinates<T extends CalculusFieldElement<T>> {
28  
29      /** Azimuth. */
30      private final T azimuth;
31  
32      /** Elevation. */
33      private final T elevation;
34  
35      /** Range. */
36      private final T range;
37  
38      /** Simple constructor.
39       * @param azimuth azimuth
40       * @param elevation elevation
41       * @param range range
42       */
43      public FieldTrackingCoordinates(final T azimuth, final T elevation, final T range) {
44          this.azimuth   = azimuth;
45          this.elevation = elevation;
46          this.range     = range;
47      }
48  
49      /** Build a new instance from a {@link TrackingCoordinates}.
50       * @param field field to which the elements belong
51       * @param trackingCoordinates tracking coordinates to convert
52       * @since 12.1
53       */
54      public FieldTrackingCoordinates(final Field<T> field, final TrackingCoordinates trackingCoordinates) {
55          this(field.getZero().newInstance(trackingCoordinates.getAzimuth()),
56               field.getZero().newInstance(trackingCoordinates.getElevation()),
57               field.getZero().newInstance(trackingCoordinates.getRange()));
58      }
59  
60      /** Get the azimuth.
61       * <p>The azimuth is the angle between the North direction at local point and
62       * the projection in local horizontal plane of the direction from local point
63       * to given point. Azimuth angles are counted clockwise, i.e positive towards the East.</p>
64       * @return azimuth
65       */
66      public T getAzimuth() {
67          return azimuth;
68      }
69  
70      /** Get the elevation.
71       * <p>The elevation is the angle between the local horizontal and
72       * the direction from local point to given point.</p>
73       * @return elevation
74       */
75      public T getElevation() {
76          return elevation;
77      }
78  
79      /** Get the range.
80       * @return range
81       */
82      public T getRange() {
83          return range;
84      }
85  
86  }
87  
88  
89