|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectjava.lang.Number
org.jscience.mathematics.algebraic.numbers.Quaternion
public final class Quaternion
The Quaternion class encapsulates quaternions.
| Field Summary | |
|---|---|
static Quaternion |
I
|
static Quaternion |
J
|
static Quaternion |
K
|
static double |
MAX_IMAGINARY_VALUE
|
static double |
MAX_REAL_VALUE
|
static double |
MIN_IMAGINARY_VALUE
|
static double |
MIN_REAL_VALUE
|
static double |
NaN
|
static double |
NEGATIVE_IMAGINARY_INFINITY
|
static double |
NEGATIVE_REAL_INFINITY
|
static Quaternion |
ONE
|
static double |
POSITIVE_IMAGINARY_INFINITY
|
static double |
POSITIVE_REAL_INFINITY
|
static java.lang.Class |
TYPE
|
static Quaternion |
ZERO
|
| Constructor Summary | |
|---|---|
Quaternion(double real,
Double3Vector imag)
Constructs a quaternion. |
|
Quaternion(double q0,
double q1,
double q2,
double q3)
Constructs the quaternion q0+iq1+jq2+kq3. |
|
Quaternion(Quaternion quat)
Constructs a quaternion. |
|
| Method Summary | |
|---|---|
AbelianGroup.Member |
add(AbelianGroup.Member x)
Returns the addition of this number and another. |
Quaternion |
add(Quaternion q)
Returns the addition of this quaternion and another. |
Quaternion |
addImag(Double3Vector imag)
Returns the addition of this quaternion with an imaginary part. |
Quaternion |
addReal(double real)
Returns the addition of this quaternion with a real part. |
java.lang.Object |
clone()
|
Quaternion |
conjugate()
Returns the conjugate of this quaternion. |
Quaternion |
divide(double x)
Returns the division of this quaternion by a scalar. |
Field.Member |
divide(Field.Member x)
Returns the division of this number and another. |
Quaternion |
divide(Quaternion q)
Returns the division of this quaternion by another. |
double |
doubleValue()
|
boolean |
equals(java.lang.Object obj)
Compares two quaternions for equality. |
float |
floatValue()
|
int |
hashCode()
Returns a hashcode for this quaternion. |
Double3Vector |
imag()
Returns the imaginary part of this quaternion. |
int |
intValue()
|
Field.Member |
inverse()
Returns the inverse of this quaternion. |
CStarAlgebra.Member |
involution()
Returns the involution of this quaternion. |
boolean |
isInfinite()
Returns true if either the real or imaginary part is infinite. |
boolean |
isNaN()
Returns true if either the real or imaginary part is NaN. |
long |
longValue()
|
Quaternion |
multiply(double x)
Returns the multiplication of this quaternion by a scalar. |
Quaternion |
multiply(Quaternion q)
Returns the multiplication of this quaternion and another. |
Ring.Member |
multiply(Ring.Member x)
Returns the multiplication of this number and another. |
AbelianGroup.Member |
negate()
Returns the negative of this quaternion. |
double |
norm()
Returns the l2-norm (magnitude), which is also the C* norm. |
double |
real()
Returns the real part of this quaternion. |
VectorSpace.Member |
scalarDivide(Field.Member x)
Returns the division of this number by a real scalar. |
Module.Member |
scalarMultiply(Ring.Member x)
Returns the multiplication of this number by a real scalar. |
AbelianGroup.Member |
subtract(AbelianGroup.Member x)
Returns the subtraction of this number and another. |
Quaternion |
subtract(Quaternion q)
Returns the subtraction of this quaternion by another. |
Quaternion |
subtractImag(Double3Vector imag)
Returns the subtraction of this quaternion by an imaginary part. |
Quaternion |
subtractReal(double real)
Returns the subtraction of this quaternion by a real part. |
double |
sumSquares()
Returns the sum of the squares of the components. |
java.lang.String |
toString()
Returns a string representing the value of this quaternion. |
| Methods inherited from class java.lang.Number |
|---|
byteValue, shortValue |
| Methods inherited from class java.lang.Object |
|---|
finalize, getClass, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static final Quaternion ZERO
public static final Quaternion ONE
public static final Quaternion I
public static final Quaternion J
public static final Quaternion K
public static final double MAX_REAL_VALUE
public static final double MIN_REAL_VALUE
public static final double MAX_IMAGINARY_VALUE
public static final double MIN_IMAGINARY_VALUE
public static final double NaN
public static final double NEGATIVE_REAL_INFINITY
public static final double POSITIVE_REAL_INFINITY
public static final double NEGATIVE_IMAGINARY_INFINITY
public static final double POSITIVE_IMAGINARY_INFINITY
public static final java.lang.Class TYPE
| Constructor Detail |
|---|
public Quaternion(double real,
Double3Vector imag)
public Quaternion(double q0,
double q1,
double q2,
double q3)
public Quaternion(Quaternion quat)
| Method Detail |
|---|
public boolean equals(java.lang.Object obj)
equals in class java.lang.Objectobj - a quaternionpublic java.lang.String toString()
toString in class java.lang.Objectpublic int hashCode()
hashCode in class java.lang.Objectpublic boolean isNaN()
public boolean isInfinite()
public double real()
public Double3Vector imag()
public double norm()
norm in interface BanachSpace.Memberpublic double sumSquares()
public int intValue()
intValue in class java.lang.Numberpublic long longValue()
longValue in class java.lang.Numberpublic float floatValue()
floatValue in class java.lang.Numberpublic double doubleValue()
doubleValue in class java.lang.Numberpublic AbelianGroup.Member negate()
negate in interface AbelianGroup.Memberpublic Field.Member inverse()
inverse in interface Field.Memberpublic CStarAlgebra.Member involution()
involution in interface CStarAlgebra.Memberpublic Quaternion conjugate()
public AbelianGroup.Member add(AbelianGroup.Member x)
add in interface AbelianGroup.Memberx - a group member
public Quaternion add(Quaternion q)
q - a quaternionpublic Quaternion addReal(double real)
real - a real partpublic Quaternion addImag(Double3Vector imag)
imag - an imaginary partpublic AbelianGroup.Member subtract(AbelianGroup.Member x)
subtract in interface AbelianGroup.Memberx - a group member
public Quaternion subtract(Quaternion q)
q - a quaternionpublic Quaternion subtractReal(double real)
real - a real partpublic Quaternion subtractImag(Double3Vector imag)
imag - an imaginary partpublic Module.Member scalarMultiply(Ring.Member x)
scalarMultiply in interface Module.Memberx - a ring member
public Ring.Member multiply(Ring.Member x)
multiply in interface Ring.Memberx - a ring member
public Quaternion multiply(Quaternion q)
q - a quaternionpublic Quaternion multiply(double x)
x - a real numberpublic VectorSpace.Member scalarDivide(Field.Member x)
scalarDivide in interface VectorSpace.Memberx - a field member
public Field.Member divide(Field.Member x)
divide in interface Field.Memberx - a field member
public Quaternion divide(Quaternion q)
q - a quaternion
java.lang.ArithmeticException - If divide by zero.public Quaternion divide(double x)
x - a real number
java.lang.ArithmeticException - If divide by zero.public java.lang.Object clone()
clone in class java.lang.Object
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||