Enum RotationOrder

  • All Implemented Interfaces:
    Serializable, Comparable<RotationOrder>

    public enum RotationOrder
    extends Enum<RotationOrder>
    Enumerate representing a rotation order specification for Cardan or Euler angles.

    Since Hipparchus 1.7 this class is an enumerate class.

    • Enum Constant Detail

      • XYZ

        public static final RotationOrder XYZ
        Set of Cardan angles. this ordered set of rotations is around X, then around Y, then around Z
      • XZY

        public static final RotationOrder XZY
        Set of Cardan angles. this ordered set of rotations is around X, then around Z, then around Y
      • YXZ

        public static final RotationOrder YXZ
        Set of Cardan angles. this ordered set of rotations is around Y, then around X, then around Z
      • YZX

        public static final RotationOrder YZX
        Set of Cardan angles. this ordered set of rotations is around Y, then around Z, then around X
      • ZXY

        public static final RotationOrder ZXY
        Set of Cardan angles. this ordered set of rotations is around Z, then around X, then around Y
      • ZYX

        public static final RotationOrder ZYX
        Set of Cardan angles. this ordered set of rotations is around Z, then around Y, then around X
      • XYX

        public static final RotationOrder XYX
        Set of Euler angles. this ordered set of rotations is around X, then around Y, then around X
      • XZX

        public static final RotationOrder XZX
        Set of Euler angles. this ordered set of rotations is around X, then around Z, then around X
      • YXY

        public static final RotationOrder YXY
        Set of Euler angles. this ordered set of rotations is around Y, then around X, then around Y
      • YZY

        public static final RotationOrder YZY
        Set of Euler angles. this ordered set of rotations is around Y, then around Z, then around Y
      • ZXZ

        public static final RotationOrder ZXZ
        Set of Euler angles. this ordered set of rotations is around Z, then around X, then around Z
      • ZYZ

        public static final RotationOrder ZYZ
        Set of Euler angles. this ordered set of rotations is around Z, then around Y, then around Z
    • Method Detail

      • values

        public static RotationOrder[] values()
        Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
        for (RotationOrder c : RotationOrder.values())
            System.out.println(c);
        
        Returns:
        an array containing the constants of this enum type, in the order they are declared
      • valueOf

        public static RotationOrder valueOf​(String name)
        Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)
        Parameters:
        name - the name of the enum constant to be returned.
        Returns:
        the enum constant with the specified name
        Throws:
        IllegalArgumentException - if this enum type has no constant with the specified name
        NullPointerException - if the argument is null
      • toString

        public String toString()
        Get a string representation of the instance.
        Overrides:
        toString in class Enum<RotationOrder>
        Returns:
        a string representation of the instance (in fact, its name)
      • getA1

        public Vector3D getA1()
        Get the axis of the first rotation.
        Returns:
        axis of the first rotation
      • getA2

        public Vector3D getA2()
        Get the axis of the second rotation.
        Returns:
        axis of the second rotation
      • getA3

        public Vector3D getA3()
        Get the axis of the third rotation.
        Returns:
        axis of the third rotation
      • getRotationOrder

        public static RotationOrder getRotationOrder​(String value)
        Get the rotation order corresponding to a string representation.
        Parameters:
        value - name
        Returns:
        a rotation order object
        Since:
        1.7
      • getAngles

        public double[] getAngles​(Rotation rotation,
                                  RotationConvention convention)
        Get the Cardan or Euler angles corresponding to the instance.

        The algorithm used here works even when the rotation is exactly at the the singularity of the rotation order and convention. In this case, one of the angles in the singular pair is arbitrarily set to exactly 0 and the second angle is computed. The angle set to 0 in the singular case is the angle of the first rotation in the case of Cardan orders, and it is the angle of the last rotation in the case of Euler orders. This implies that extracting the angles of a rotation never fails (it used to trigger an exception in singular cases up to Hipparchus 3.0).

        Parameters:
        rotation - rotation from which angles should be extracted
        convention - convention to use for the semantics of the angle
        Returns:
        an array of three angles, in the order specified by the set
        Since:
        3.1
      • getAngles

        public <T extends CalculusFieldElement<T>> T[] getAngles​(FieldRotation<T> rotation,
                                                                 RotationConvention convention)
        Get the Cardan or Euler angles corresponding to the instance.

        The algorithm used here works even when the rotation is exactly at the the singularity of the rotation order and convention. In this case, one of the angles in the singular pair is arbitrarily set to exactly 0 and the second angle is computed. The angle set to 0 in the singular case is the angle of the first rotation in the case of Cardan orders, and it is the angle of the last rotation in the case of Euler orders. This implies that extracting the angles of a rotation never fails (it used to trigger an exception in singular cases up to Hipparchus 3.0).

        Type Parameters:
        T - type of the field elements
        Parameters:
        rotation - rotation from which angles should be extracted
        convention - convention to use for the semantics of the angle
        Returns:
        an array of three angles, in the order specified by the set
        Since:
        3.1