Package gnu.math
Class DQuaternion
- java.lang.Object
-
- java.lang.Number
-
- gnu.math.Numeric
-
- gnu.math.Quantity
-
- gnu.math.Quaternion
-
- gnu.math.DQuaternion
-
- All Implemented Interfaces:
Externalizable
,Serializable
public class DQuaternion extends Quaternion implements Externalizable
A quaternion number using plain double values.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description DQuaternion()
DQuaternion(double real, double imag, double jmag, double kmag)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description Numeric
add(Object y, int k)
Return this + k * obj.static Quaternion
cos(double x_re, double x_im, double x_jm, double x_km)
static Quaternion
div(double x_re, double x_im, double x_jm, double x_km, double y_re, double y_im, double y_jm, double y_km)
Numeric
div(Object y)
double
doubleImagValue()
The value of the imaginary component, as a double.double
doubleJmagValue()
The value of the "j" component, as a double.double
doubleKmagValue()
The value of the "k" component, as a double.double
doubleValue()
The value of the real component, as a double.boolean
equals(Object obj)
static Quaternion
exp(double x_re, double x_im, double x_jm, double x_km)
static double
hypot3(double x, double y, double z)
static double
hypot4(double w, double x, double y, double z)
RealNum
im()
The value of the imaginary component, as a RealNum.boolean
isExact()
RealNum
jm()
The value of the "j" component, as a RealNum.RealNum
km()
The value of the "k" component, as a RealNum.static Quaternion
log(double x_re, double x_im, double x_jm, double x_km)
Numeric
mul(Object y)
Numeric
neg()
static Quaternion
power(double x_re, double x_im, double x_jm, double x_km, double y_re, double y_im, double y_jm, double y_km)
RealNum
re()
The value of the real component, as a RealNum.void
readExternal(ObjectInput in)
static Quaternion
sin(double x_re, double x_im, double x_jm, double x_km)
static Quaternion
sqrt(double x_re, double x_im, double x_jm, double x_km)
static Quaternion
tan(double x_re, double x_im, double x_jm, double x_km)
Quaternion
toExact()
String
toString()
String
toString(int radix)
void
writeExternal(ObjectOutput out)
-
Methods inherited from class gnu.math.Quaternion
abs, add, addReversed, angle, classifyFinite, colatitude, compare, compare, complexPart, conjugate, cos, divide, divReversed, doubleRealValue, equals, exp, isZero, jmMinusOne, jmOne, kmMinusOne, kmOne, log, longitude, longValue, make, make, mulReversed, neg, number, polar, polar, power, sin, sqrt, tan, times, toInexact, unitQuaternion, unitVector, vectorPart
-
Methods inherited from class gnu.math.Quantity
add, compare, compareReversed, dimensions, divide, imValue, jmValue, kmValue, make, make, make, reValue, times, unit
-
Methods inherited from class gnu.math.Numeric
add, asNumericOrNull, div_inv, floatValue, geq, grt, intValue, mul_ident, power, sub
-
Methods inherited from class java.lang.Number
byteValue, shortValue
-
-
-
-
Method Detail
-
re
public RealNum re()
Description copied from class:Quantity
The value of the real component, as a RealNum. The unit() is not factored in, so you actually need to multiply by unit() to get the true real component.
-
doubleValue
public double doubleValue()
Description copied from class:Quantity
The value of the real component, as a double. This is relative to the unit().dims - i.e. unit()/doubleValue() is factored in.- Overrides:
doubleValue
in classQuaternion
-
im
public RealNum im()
Description copied from class:Quantity
The value of the imaginary component, as a RealNum. The unit() is not factored in, so you actually need to multiply by unit() to get the true imaginary component.
-
doubleImagValue
public double doubleImagValue()
Description copied from class:Quantity
The value of the imaginary component, as a double. This is relative to the unit().dims - i.e. unit()/doubleValue() is factored in.- Overrides:
doubleImagValue
in classQuaternion
-
jm
public RealNum jm()
Description copied from class:Quantity
The value of the "j" component, as a RealNum. The unit() is not factored in, so you actually need to multiply by unit() to get the true "j" component.
-
doubleJmagValue
public double doubleJmagValue()
Description copied from class:Quantity
The value of the "j" component, as a double. This is relative to the unit().dims - i.e. unit()/doubleValue() is factored in.- Overrides:
doubleJmagValue
in classQuaternion
-
km
public RealNum km()
Description copied from class:Quantity
The value of the "k" component, as a RealNum. The unit() is not factored in, so you actually need to multiply by unit() to get the true "k" component.
-
doubleKmagValue
public double doubleKmagValue()
Description copied from class:Quantity
The value of the "k" component, as a double. This is relative to the unit().dims - i.e. unit()/doubleValue() is factored in.- Overrides:
doubleKmagValue
in classQuaternion
-
isExact
public boolean isExact()
- Overrides:
isExact
in classQuaternion
-
toExact
public Quaternion toExact()
- Overrides:
toExact
in classQuaternion
-
equals
public boolean equals(Object obj)
- Overrides:
equals
in classQuaternion
-
toString
public String toString(int radix)
- Overrides:
toString
in classQuaternion
-
neg
public final Numeric neg()
- Overrides:
neg
in classQuaternion
-
add
public Numeric add(Object y, int k)
Description copied from class:Numeric
Return this + k * obj.- Overrides:
add
in classQuaternion
-
mul
public Numeric mul(Object y)
- Overrides:
mul
in classQuaternion
-
div
public Numeric div(Object y)
- Overrides:
div
in classQuaternion
-
hypot4
public static double hypot4(double w, double x, double y, double z)
-
hypot3
public static double hypot3(double x, double y, double z)
-
power
public static Quaternion power(double x_re, double x_im, double x_jm, double x_km, double y_re, double y_im, double y_jm, double y_km)
-
exp
public static Quaternion exp(double x_re, double x_im, double x_jm, double x_km)
-
log
public static Quaternion log(double x_re, double x_im, double x_jm, double x_km)
-
div
public static Quaternion div(double x_re, double x_im, double x_jm, double x_km, double y_re, double y_im, double y_jm, double y_km)
-
sqrt
public static Quaternion sqrt(double x_re, double x_im, double x_jm, double x_km)
-
sin
public static Quaternion sin(double x_re, double x_im, double x_jm, double x_km)
-
cos
public static Quaternion cos(double x_re, double x_im, double x_jm, double x_km)
-
tan
public static Quaternion tan(double x_re, double x_im, double x_jm, double x_km)
-
writeExternal
public void writeExternal(ObjectOutput out) throws IOException
- Specified by:
writeExternal
in interfaceExternalizable
- Throws:
IOException
-
readExternal
public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException
- Specified by:
readExternal
in interfaceExternalizable
- Throws:
IOException
ClassNotFoundException
-
-