Enum Quaternion.Type

  • All Implemented Interfaces:
    java.io.Serializable, java.lang.Comparable<Quaternion.Type>
    Enclosing class:
    Quaternion

    private static enum Quaternion.Type
    extends java.lang.Enum<Quaternion.Type>
    For enabling optimized implementations.
    • Enum Constant Detail

      • DEFAULT

        public static final Quaternion.Type DEFAULT
        Default implementation.
      • NORMALIZED

        public static final Quaternion.Type NORMALIZED
        Quaternion has unit norm.
      • POSITIVE_POLAR_FORM

        public static final Quaternion.Type POSITIVE_POLAR_FORM
        Quaternion has positive scalar part.
    • Constructor Detail

      • Type

        private Type​(java.util.function.ToDoubleFunction<Quaternion> normSq,
                     java.util.function.ToDoubleFunction<Quaternion> norm,
                     java.util.function.BiPredicate<Quaternion,​java.lang.Double> isUnit)
        Parameters:
        normSq - normSq method.
        norm - norm method.
        isUnit - isUnit method.
    • Method Detail

      • values

        public static Quaternion.Type[] 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 (Quaternion.Type c : Quaternion.Type.values())
            System.out.println(c);
        
        Returns:
        an array containing the constants of this enum type, in the order they are declared
      • valueOf

        public static Quaternion.Type valueOf​(java.lang.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:
        java.lang.IllegalArgumentException - if this enum type has no constant with the specified name
        java.lang.NullPointerException - if the argument is null
      • normSq

        double normSq​(Quaternion q)
        Parameters:
        q - Quaternion.
        Returns:
        the norm squared.
      • norm

        double norm​(Quaternion q)
        Parameters:
        q - Quaternion.
        Returns:
        the norm.
      • isUnit

        boolean isUnit​(Quaternion q,
                       double eps)
        Parameters:
        q - Quaternion.
        eps - Tolerance.
        Returns:
        whether q has unit norm within the allowed tolerance.