1   /* Copyright 2022-2026 Romain Serra
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.geometry.euclidean.threed.Vector3D;
20  import org.orekit.bodies.BodyShape;
21  import org.orekit.bodies.GeodeticPoint;
22  import org.orekit.time.AbsoluteDate;
23  
24  
25  /** Position provider from a given fixed point w.r.t. to a body.
26   * @author Romain Serra
27   * @since 14.0
28   * @see PVCoordinatesProvider
29   * @see GeodeticPoint
30   */
31  public class GeodeticExtendedPositionProvider extends ConstantPositionProvider {
32  
33      /** Body shape on which the local point is defined. */
34      private final BodyShape bodyShape;
35  
36      /** Geodetic point. */
37      private final GeodeticPoint geodeticPoint;
38  
39      /** Simple constructor.
40       * @param bodyShape body shape on which the local point is defined
41       * @param point local surface point
42       */
43      public GeodeticExtendedPositionProvider(final BodyShape bodyShape, final GeodeticPoint point) {
44          super(bodyShape.transform(point), bodyShape.getBodyFrame());
45          this.bodyShape = bodyShape;
46          this.geodeticPoint = point;
47      }
48  
49      /** Simple constructor.
50       * @param bodyShape body shape on which the local point is defined
51       * @param point local surface point
52       */
53      public GeodeticExtendedPositionProvider(final BodyShape bodyShape, final Vector3D point) {
54          super(point, bodyShape.getBodyFrame());
55          this.geodeticPoint = bodyShape.transform(point, bodyShape.getBodyFrame(), AbsoluteDate.ARBITRARY_EPOCH);
56          this.bodyShape = bodyShape;
57      }
58  
59      /** Get the body shape on which the local point is defined.
60       * @return body shape on which the local point is defined
61       */
62      public BodyShape getBodyShape() {
63          return bodyShape;
64      }
65  
66      /** Get the surface point.
67       * @return surface point
68       */
69      public GeodeticPoint getGeodeticPoint() {
70          return geodeticPoint;
71      }
72  
73  }