ConstantAzimuthAiming.java

  1. /* Copyright 2002-2018 CS Systèmes d'Information
  2.  * Licensed to CS Systèmes d'Information (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 org.hipparchus.geometry.euclidean.threed.Vector3D;
  19. import org.hipparchus.util.FastMath;
  20. import org.orekit.bodies.GeodeticPoint;
  21. import org.orekit.bodies.OneAxisEllipsoid;

  22. /** Class used to orient tiles with respect to a geographic azimuth.
  23.  * @see AlongTrackAiming
  24.  * @author Luc Maisonobe
  25.  */
  26. public class ConstantAzimuthAiming implements TileAiming {

  27.     /** Cosine of the azimuth. */
  28.     private final double cos;

  29.     /** Sine of the azimuth. */
  30.     private final double sin;

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

  39.     /** {@inheritDoc} */
  40.     @Override
  41.     public Vector3D alongTileDirection(final Vector3D point, final GeodeticPoint gp) {

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

  44.     }

  45. }