1 /* Copyright 2002-2025 CS GROUP
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.models.earth.tessellation;
18
19 import java.util.Arrays;
20 import java.util.List;
21
22 import org.hipparchus.geometry.euclidean.threed.Vector3D;
23 import org.hipparchus.util.FastMath;
24 import org.hipparchus.util.SinCos;
25 import org.orekit.bodies.GeodeticPoint;
26 import org.orekit.bodies.OneAxisEllipsoid;
27
28 /** Class used to orient tiles with respect to a geographic azimuth.
29 * @see AlongTrackAiming
30 * @see DivertedSingularityAiming
31 * @author Luc Maisonobe
32 */
33 public class ConstantAzimuthAiming implements TileAiming {
34
35 /** Sine and Cosine of the azimuth. */
36 private final SinCos sc;
37
38 /** Simple constructor.
39 * @param ellipsoid ellipsoid body on which the zone is defined
40 * @param azimuth geographic azimuth of the tiles
41 */
42 public ConstantAzimuthAiming(final OneAxisEllipsoid ellipsoid, final double azimuth) {
43 this.sc = FastMath.sinCos(azimuth);
44 }
45
46 /** {@inheritDoc} */
47 @Override
48 public List<GeodeticPoint> getSingularPoints() {
49 return Arrays.asList(GeodeticPoint.NORTH_POLE, GeodeticPoint.SOUTH_POLE);
50 }
51
52 /** {@inheritDoc} */
53 @Override
54 public Vector3D alongTileDirection(final Vector3D point, final GeodeticPoint gp) {
55
56 // compute the horizontal direction at fixed azimuth
57 return new Vector3D(sc.cos(), gp.getNorth(), sc.sin(), gp.getEast());
58
59 }
60
61 }