View Javadoc
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  /*
19   * This is not the original file distributed by the Apache Software Foundation
20   * It has been modified by the Hipparchus project
21   */
22  
23  package org.hipparchus.geometry.euclidean.threed;
24  
25  /**
26   * This enumerates is used to differentiate the semantics of a rotation.
27   * @see Rotation
28   */
29  public enum RotationConvention {
30  
31      /** Constant for rotation that have the semantics of a vector operator.
32       * <p>
33       * According to this convention, the rotation moves vectors with respect
34       * to a fixed reference frame.
35       * </p>
36       * <p>
37       * This means that if we define rotation r is a 90 degrees rotation around
38       * the Z axis, the image of vector {@link Vector3D#PLUS_I} would be
39       * {@link Vector3D#PLUS_J}, the image of vector {@link Vector3D#PLUS_J}
40       * would be {@link Vector3D#MINUS_I}, the image of vector {@link Vector3D#PLUS_K}
41       * would be {@link Vector3D#PLUS_K}, and the image of vector with coordinates (1, 2, 3)
42       * would be vector (-2, 1, 3). This means that the vector rotates counterclockwise.
43       * </p>
44       * <p>
45       * This convention was the only one supported by Hipparchus up to version 3.5.
46       * </p>
47       * <p>
48       * The difference with {@link #FRAME_TRANSFORM} is only the semantics of the sign
49       * of the angle. It is always possible to create or use a rotation using either
50       * convention to really represent a rotation that would have been best created or
51       * used with the other convention, by changing accordingly the sign of the
52       * rotation angle. This is how things were done up to version 3.5.
53       * </p>
54       */
55      VECTOR_OPERATOR,
56  
57      /** Constant for rotation that have the semantics of a frame conversion.
58       * <p>
59       * According to this convention, the rotation considered vectors to be fixed,
60       * but their coordinates change as they are converted from an initial frame to
61       * a destination frame rotated with respect to the initial frame.
62       * </p>
63       * <p>
64       * This means that if we define rotation r is a 90 degrees rotation around
65       * the Z axis, the image of vector {@link Vector3D#PLUS_I} would be
66       * {@link Vector3D#MINUS_J}, the image of vector {@link Vector3D#PLUS_J}
67       * would be {@link Vector3D#PLUS_I}, the image of vector {@link Vector3D#PLUS_K}
68       * would be {@link Vector3D#PLUS_K}, and the image of vector with coordinates (1, 2, 3)
69       * would be vector (2, -1, 3). This means that the coordinates of the vector rotates
70       * clockwise, because they are expressed with respect to a destination frame that is rotated
71       * counterclockwise.
72       * </p>
73       * <p>
74       * The difference with {@link #VECTOR_OPERATOR} is only the semantics of the sign
75       * of the angle. It is always possible to create or use a rotation using either
76       * convention to really represent a rotation that would have been best created or
77       * used with the other convention, by changing accordingly the sign of the
78       * rotation angle. This is how things were done up to version 3.5.
79       * </p>
80       */
81      FRAME_TRANSFORM;
82  
83  }