Enum Quaternion.Type
- java.lang.Object
-
- java.lang.Enum<Quaternion.Type>
-
- org.apache.commons.numbers.quaternion.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.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description private static classQuaternion.Type.DefaultDefault implementations.private static classQuaternion.Type.NormalizedImplementations for normalized quaternions.
-
Enum Constant Summary
Enum Constants Enum Constant Description DEFAULTDefault implementation.NORMALIZEDQuaternion has unit norm.POSITIVE_POLAR_FORMQuaternion has positive scalar part.
-
Field Summary
Fields Modifier and Type Field Description private java.util.function.ToDoubleFunction<Quaternion>normprivate java.util.function.ToDoubleFunction<Quaternion>normSqprivate java.util.function.BiPredicate<Quaternion,java.lang.Double>testIsUnit
-
Constructor Summary
Constructors Modifier Constructor Description privateType(java.util.function.ToDoubleFunction<Quaternion> normSq, java.util.function.ToDoubleFunction<Quaternion> norm, java.util.function.BiPredicate<Quaternion,java.lang.Double> isUnit)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description (package private) booleanisUnit(Quaternion q, double eps)(package private) doublenorm(Quaternion q)(package private) doublenormSq(Quaternion q)static Quaternion.TypevalueOf(java.lang.String name)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 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.
-
-
Field Detail
-
normSq
private final java.util.function.ToDoubleFunction<Quaternion> normSq
-
norm
private final java.util.function.ToDoubleFunction<Quaternion> norm
-
testIsUnit
private final java.util.function.BiPredicate<Quaternion,java.lang.Double> testIsUnit
-
-
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-normSqmethod.norm-normmethod.isUnit-isUnitmethod.
-
-
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 namejava.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
qhas unit norm within the allowed tolerance.
-
-