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 * 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 18 package org.apache.commons.math3.geometry.euclidean.threed; 19 20 /** 21 * This enumerates is used to differentiate the semantics of a rotation. 22 * @see Rotation 23 * @since 3.6 24 */ 25 public enum RotationConvention { 26 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 Apache Commons Math 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 53 /** Constant for rotation that have the semantics of a frame conversion. 54 * <p> 55 * According to this convention, the rotation considered vectors to be fixed, 56 * but their coordinates change as they are converted from an initial frame to 57 * a destination frame rotated with respect to the initial frame. 58 * </p> 59 * <p> 60 * This means that if we define rotation r is a 90 degrees rotation around 61 * the Z axis, the image of vector {@link Vector3D#PLUS_I} would be 62 * {@link Vector3D#MINUS_J}, the image of vector {@link Vector3D#PLUS_J} 63 * would be {@link Vector3D#PLUS_I}, the image of vector {@link Vector3D#PLUS_K} 64 * would be {@link Vector3D#PLUS_K}, and the image of vector with coordinates (1, 2, 3) 65 * would be vector (2, -1, 3). This means that the coordinates of the vector rotates 66 * clockwise, because they are expressed with respect to a destination frame that is rotated 67 * counterclockwise. 68 * </p> 69 * <p> 70 * The difference with {@link #VECTOR_OPERATOR} is only the semantics of the sign 71 * of the angle. It is always possible to create or use a rotation using either 72 * convention to really represent a rotation that would have been best created or 73 * used with the other convention, by changing accordingly the sign of the 74 * rotation angle. This is how things were done up to version 3.5. 75 * </p> 76 */ 77 FRAME_TRANSFORM; 78 79 } 80