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 class
Quaternion.Type.Default
Default implementations.private static class
Quaternion.Type.Normalized
Implementations for normalized quaternions.
-
Enum Constant Summary
Enum Constants Enum Constant Description DEFAULT
Default implementation.NORMALIZED
Quaternion has unit norm.POSITIVE_POLAR_FORM
Quaternion has positive scalar part.
-
Field Summary
Fields Modifier and Type Field Description private java.util.function.ToDoubleFunction<Quaternion>
norm
private java.util.function.ToDoubleFunction<Quaternion>
normSq
private java.util.function.BiPredicate<Quaternion,java.lang.Double>
testIsUnit
-
Constructor Summary
Constructors Modifier Constructor Description private
Type(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) boolean
isUnit(Quaternion q, double eps)
(package private) double
norm(Quaternion q)
(package private) double
normSq(Quaternion q)
static Quaternion.Type
valueOf(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
-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 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
q
has unit norm within the allowed tolerance.
-
-