Package gnu.math
Class Quaternion
java.lang.Object
java.lang.Number
gnu.math.Numeric
gnu.math.Quantity
gnu.math.Quaternion
- All Implemented Interfaces:
Serializable
- Direct Known Subclasses:
Complex,CQuaternion,DQuaternion
A quaternion is a hypercomplex number of the form w + xi + yj + zk
where w, x, y, and k are real, and i, j, and k are imaginary units
which satisfy i^2 = j^2 = k^2 = ijk = -1.
- See Also:
-
Field Summary
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionabs()static Quaternionadd(Quaternion x, Quaternion y, int k) Return this + k * obj.addReversed(Numeric x, int k) Calculatex+k&this.angle()intCheck if value is finite, infinite, or NaN.static intcompare(Quaternion x, Quaternion y) intReturn an integer for which ofthisorobjis larger.cos()static Quaterniondivide(Quaternion x, Quaternion y) doubleThe value of the imaginary component, as a double.doubleThe value of the "j" component, as a double.doubleThe value of the "k" component, as a double.final doubledoubleThe value of the real component, as a double.static booleanequals(Quaternion x, Quaternion y) booleanexp()booleanisExact()booleanisZero()static CQuaternionstatic CQuaternionjmOne()static CQuaternionstatic CQuaternionkmOne()log()longstatic Quaternionmake(double re, double im, double jm, double km) static Quaternionneg()static Quaternionneg(Quaternion x) number()static Quaternionpolar(double r, double t, double u, double v) static Quaternionstatic Quaternionpower(Quaternion x, Quaternion y) sin()sqrt()tan()static Quaterniontimes(Quaternion x, Quaternion y) toExact()toString(int radix) Methods inherited from class gnu.math.Quantity
add, compare, compareReversed, dimensions, divide, im, imValue, jm, jmValue, km, kmValue, make, make, make, re, reValue, times, unitMethods inherited from class gnu.math.Numeric
add, asNumericOrNull, div_inv, floatValue, geq, grt, intValue, mul_ident, power, sub, toStringMethods inherited from class java.lang.Number
byteValue, shortValue
-
Constructor Details
-
Quaternion
public Quaternion()
-
-
Method Details
-
number
-
isExact
public boolean isExact() -
classifyFinite
public int classifyFinite()Check if value is finite, infinite, or NaN.- Returns:
- 1 if finite; 0 if infinite; -1 if NaN.
-
toExact
-
toInexact
-
jmOne
-
jmMinusOne
-
kmOne
-
kmMinusOne
-
doubleValue
public double doubleValue()Description copied from class:QuantityThe value of the real component, as a double. This is relative to the unit().dims - i.e. unit()/doubleValue() is factored in.- Overrides:
doubleValuein classQuantity
-
doubleImagValue
public double doubleImagValue()Description copied from class:QuantityThe value of the imaginary component, as a double. This is relative to the unit().dims - i.e. unit()/doubleValue() is factored in.- Overrides:
doubleImagValuein classQuantity
-
doubleJmagValue
public double doubleJmagValue()Description copied from class:QuantityThe value of the "j" component, as a double. This is relative to the unit().dims - i.e. unit()/doubleValue() is factored in.- Overrides:
doubleJmagValuein classQuantity
-
doubleKmagValue
public double doubleKmagValue()Description copied from class:QuantityThe value of the "k" component, as a double. This is relative to the unit().dims - i.e. unit()/doubleValue() is factored in.- Overrides:
doubleKmagValuein classQuantity
-
doubleRealValue
public final double doubleRealValue() -
longValue
public long longValue() -
complexPart
-
vectorPart
-
unitVector
-
unitQuaternion
-
make
-
make
-
polar
-
polar
-
power
-
abs
-
angle
-
colatitude
-
longitude
-
conjugate
-
equals
-
equals
-
compare
-
compare
Description copied from class:NumericReturn an integer for which ofthisorobjis larger. Return 1 ifthis>obj; 0 ifthis==obj; -1 ifthis<obj; -2 ifthis!=objotherwise (for example if either is NaN); -3 if not comparable (incompatible types). -
isZero
public boolean isZero() -
toString
-
neg
-
neg
-
add
-
add
Description copied from class:NumericReturn this + k * obj. -
addReversed
Description copied from class:NumericCalculatex+k&this.- Overrides:
addReversedin classQuantity
-
times
-
mul
-
mulReversed
- Overrides:
mulReversedin classQuantity
-
divide
-
div
-
divReversed
- Overrides:
divReversedin classQuantity
-
exp
-
log
-
sqrt
-
sin
-
cos
-
tan
-