Enum Quaternion.Type
- All Implemented Interfaces:
Serializable
,Comparable<Quaternion.Type>
,java.lang.constant.Constable
- Enclosing class:
Quaternion
For enabling optimized implementations.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprivate static final class
Default implementations.private static final class
Implementations for normalized quaternions.Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>>
-
Enum Constant Summary
Enum ConstantsEnum ConstantDescriptionDefault implementation.Quaternion has unit norm.Quaternion has positive scalar part. -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final ToDoubleFunction
<Quaternion> private final ToDoubleFunction
<Quaternion> private final BiPredicate
<Quaternion, Double> -
Constructor Summary
ConstructorsModifierConstructorDescriptionprivate
Type
(ToDoubleFunction<Quaternion> normSq, ToDoubleFunction<Quaternion> norm, BiPredicate<Quaternion, Double> isUnit) -
Method Summary
Modifier and TypeMethodDescription(package private) boolean
isUnit
(Quaternion q, double eps) (package private) double
norm
(Quaternion q) (package private) double
normSq
(Quaternion q) static Quaternion.Type
Returns the enum constant of this type with the specified name.static Quaternion.Type[]
values()
Returns an array containing the constants of this enum type, in the order they are declared.
-
Enum Constant Details
-
DEFAULT
Default implementation. -
NORMALIZED
Quaternion has unit norm. -
POSITIVE_POLAR_FORM
Quaternion has positive scalar part.
-
-
Field Details
-
normSq
-
norm
-
testIsUnit
-
-
Constructor Details
-
Type
private Type(ToDoubleFunction<Quaternion> normSq, ToDoubleFunction<Quaternion> norm, BiPredicate<Quaternion, Double> isUnit) - Parameters:
normSq
-normSq
method.norm
-norm
method.isUnit
-isUnit
method.
-
-
Method Details
-
values
Returns an array containing the constants of this enum type, in the order they are declared.- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
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 nameNullPointerException
- if the argument is null
-
normSq
- Parameters:
q
- Quaternion.- Returns:
- the norm squared.
-
norm
- Parameters:
q
- Quaternion.- Returns:
- the norm.
-
isUnit
- Parameters:
q
- Quaternion.eps
- Tolerance.- Returns:
- whether
q
has unit norm within the allowed tolerance.
-