ConstantAzimuthAiming.java

  1. /* Copyright 2002-2022 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. import java.util.Arrays;
  19. import java.util.List;

  20. import org.hipparchus.geometry.euclidean.threed.Vector3D;
  21. import org.hipparchus.util.FastMath;
  22. import org.hipparchus.util.SinCos;
  23. import org.orekit.bodies.GeodeticPoint;
  24. import org.orekit.bodies.OneAxisEllipsoid;

  25. /** Class used to orient tiles with respect to a geographic azimuth.
  26.  * @see AlongTrackAiming
  27.  * @see DivertedSingularityAiming
  28.  * @author Luc Maisonobe
  29.  */
  30. public class ConstantAzimuthAiming implements TileAiming {

  31.     /** Sine and Cosine of the azimuth. */
  32.     private final SinCos sc;

  33.     /** Simple constructor.
  34.      * @param ellipsoid ellipsoid body on which the zone is defined
  35.      * @param azimuth geographic azimuth of the tiles
  36.      */
  37.     public ConstantAzimuthAiming(final OneAxisEllipsoid ellipsoid, final double azimuth) {
  38.         this.sc = FastMath.sinCos(azimuth);
  39.     }

  40.     /** {@inheritDoc} */
  41.     @Override
  42.     public List<GeodeticPoint> getSingularPoints() {
  43.         return Arrays.asList(GeodeticPoint.NORTH_POLE, GeodeticPoint.SOUTH_POLE);
  44.     }

  45.     /** {@inheritDoc} */
  46.     @Override
  47.     public Vector3D alongTileDirection(final Vector3D point, final GeodeticPoint gp) {

  48.         // compute the horizontal direction at fixed azimuth
  49.         return new Vector3D(sc.cos(), gp.getNorth(), sc.sin(), gp.getEast());

  50.     }

  51. }