001/*
002 * Licensed to the Apache Software Foundation (ASF) under one or more
003 * contributor license agreements.  See the NOTICE file distributed with
004 * this work for additional information regarding copyright ownership.
005 * The ASF licenses this file to You under the Apache License, Version 2.0
006 * (the "License"); you may not use this file except in compliance with
007 * the License.  You may obtain a copy of the License at
008 *
009 *      http://www.apache.org/licenses/LICENSE-2.0
010 *
011 * Unless required by applicable law or agreed to in writing, software
012 * distributed under the License is distributed on an "AS IS" BASIS,
013 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
014 * See the License for the specific language governing permissions and
015 * limitations under the License.
016 */
017
018package org.apache.commons.math3.geometry.euclidean.threed;
019
020/**
021 * This enumerates is used to differentiate the semantics of a rotation.
022 * @see Rotation
023 * @since 3.6
024 */
025public enum RotationConvention {
026
027    /** Constant for rotation that have the semantics of a vector operator.
028     * <p>
029     * According to this convention, the rotation moves vectors with respect
030     * to a fixed reference frame.
031     * </p>
032     * <p>
033     * This means that if we define rotation r is a 90 degrees rotation around
034     * the Z axis, the image of vector {@link Vector3D#PLUS_I} would be
035     * {@link Vector3D#PLUS_J}, the image of vector {@link Vector3D#PLUS_J}
036     * would be {@link Vector3D#MINUS_I}, the image of vector {@link Vector3D#PLUS_K}
037     * would be {@link Vector3D#PLUS_K}, and the image of vector with coordinates (1, 2, 3)
038     * would be vector (-2, 1, 3). This means that the vector rotates counterclockwise.
039     * </p>
040     * <p>
041     * This convention was the only one supported by Apache Commons Math up to version 3.5.
042     * </p>
043     * <p>
044     * The difference with {@link #FRAME_TRANSFORM} is only the semantics of the sign
045     * of the angle. It is always possible to create or use a rotation using either
046     * convention to really represent a rotation that would have been best created or
047     * used with the other convention, by changing accordingly the sign of the
048     * rotation angle. This is how things were done up to version 3.5.
049     * </p>
050     */
051    VECTOR_OPERATOR,
052
053    /** Constant for rotation that have the semantics of a frame conversion.
054     * <p>
055     * According to this convention, the rotation considered vectors to be fixed,
056     * but their coordinates change as they are converted from an initial frame to
057     * a destination frame rotated with respect to the initial frame.
058     * </p>
059     * <p>
060     * This means that if we define rotation r is a 90 degrees rotation around
061     * the Z axis, the image of vector {@link Vector3D#PLUS_I} would be
062     * {@link Vector3D#MINUS_J}, the image of vector {@link Vector3D#PLUS_J}
063     * would be {@link Vector3D#PLUS_I}, the image of vector {@link Vector3D#PLUS_K}
064     * would be {@link Vector3D#PLUS_K}, and the image of vector with coordinates (1, 2, 3)
065     * would be vector (2, -1, 3). This means that the coordinates of the vector rotates
066     * clockwise, because they are expressed with respect to a destination frame that is rotated
067     * counterclockwise.
068     * </p>
069     * <p>
070     * The difference with {@link #VECTOR_OPERATOR} is only the semantics of the sign
071     * of the angle. It is always possible to create or use a rotation using either
072     * convention to really represent a rotation that would have been best created or
073     * used with the other convention, by changing accordingly the sign of the
074     * rotation angle. This is how things were done up to version 3.5.
075     * </p>
076     */
077    FRAME_TRANSFORM;
078
079}