RotationConvention.java

  1. /*
  2.  * Licensed to the Apache Software Foundation (ASF) under one or more
  3.  * contributor license agreements.  See the NOTICE file distributed with
  4.  * this work for additional information regarding copyright ownership.
  5.  * The ASF 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.  *      https://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. /*
  18.  * This is not the original file distributed by the Apache Software Foundation
  19.  * It has been modified by the Hipparchus project
  20.  */

  21. package org.hipparchus.geometry.euclidean.threed;

  22. /**
  23.  * This enumerates is used to differentiate the semantics of a rotation.
  24.  * @see Rotation
  25.  */
  26. public enum RotationConvention {

  27.     /** Constant for rotation that have the semantics of a vector operator.
  28.      * <p>
  29.      * According to this convention, the rotation moves vectors with respect
  30.      * to a fixed reference frame.
  31.      * </p>
  32.      * <p>
  33.      * This means that if we define rotation r is a 90 degrees rotation around
  34.      * the Z axis, the image of vector {@link Vector3D#PLUS_I} would be
  35.      * {@link Vector3D#PLUS_J}, the image of vector {@link Vector3D#PLUS_J}
  36.      * would be {@link Vector3D#MINUS_I}, the image of vector {@link Vector3D#PLUS_K}
  37.      * would be {@link Vector3D#PLUS_K}, and the image of vector with coordinates (1, 2, 3)
  38.      * would be vector (-2, 1, 3). This means that the vector rotates counterclockwise.
  39.      * </p>
  40.      * <p>
  41.      * This convention was the only one supported by Hipparchus up to version 3.5.
  42.      * </p>
  43.      * <p>
  44.      * The difference with {@link #FRAME_TRANSFORM} is only the semantics of the sign
  45.      * of the angle. It is always possible to create or use a rotation using either
  46.      * convention to really represent a rotation that would have been best created or
  47.      * used with the other convention, by changing accordingly the sign of the
  48.      * rotation angle. This is how things were done up to version 3.5.
  49.      * </p>
  50.      */
  51.     VECTOR_OPERATOR,

  52.     /** Constant for rotation that have the semantics of a frame conversion.
  53.      * <p>
  54.      * According to this convention, the rotation considered vectors to be fixed,
  55.      * but their coordinates change as they are converted from an initial frame to
  56.      * a destination frame rotated with respect to the initial frame.
  57.      * </p>
  58.      * <p>
  59.      * This means that if we define rotation r is a 90 degrees rotation around
  60.      * the Z axis, the image of vector {@link Vector3D#PLUS_I} would be
  61.      * {@link Vector3D#MINUS_J}, the image of vector {@link Vector3D#PLUS_J}
  62.      * would be {@link Vector3D#PLUS_I}, the image of vector {@link Vector3D#PLUS_K}
  63.      * would be {@link Vector3D#PLUS_K}, and the image of vector with coordinates (1, 2, 3)
  64.      * would be vector (2, -1, 3). This means that the coordinates of the vector rotates
  65.      * clockwise, because they are expressed with respect to a destination frame that is rotated
  66.      * counterclockwise.
  67.      * </p>
  68.      * <p>
  69.      * The difference with {@link #VECTOR_OPERATOR} is only the semantics of the sign
  70.      * of the angle. It is always possible to create or use a rotation using either
  71.      * convention to really represent a rotation that would have been best created or
  72.      * used with the other convention, by changing accordingly the sign of the
  73.      * rotation angle. This is how things were done up to version 3.5.
  74.      * </p>
  75.      */
  76.     FRAME_TRANSFORM

  77. }