|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object JSci.maths.Quaternion
public final class Quaternion
The Quaternion class encapsulates quaternions.
Field Summary | |
---|---|
static Quaternion |
I
|
static Quaternion |
J
|
static Quaternion |
K
|
static Quaternion |
ONE
|
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. |
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. |
Quaternion |
conjugate()
Returns the conjugate of this quaternion. |
static Quaternion |
cos(Quaternion q)
|
static Quaternion |
cosh(Quaternion q)
|
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. |
boolean |
equals(java.lang.Object obj)
Compares two quaternions for equality. |
static Quaternion |
exp(Quaternion q)
|
java.lang.Object |
getSet()
|
int |
hashCode()
Returns a hashcode for this quaternion. |
Double3Vector |
imag()
Returns the imaginary part of this quaternion. |
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. |
static Quaternion |
log(Quaternion q)
|
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. |
Quaternion |
normalize()
|
double |
real()
Returns the real part of this quaternion. |
static Quaternion |
rotation(AbstractDoubleSquareMatrix m)
Constructs a quaternion representing a rotation matrix. |
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. |
static Quaternion |
sin(Quaternion q)
|
static Quaternion |
sinh(Quaternion q)
|
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. |
static Quaternion |
tan(Quaternion q)
|
static Quaternion |
tanh(Quaternion q)
|
AbstractDoubleSquareMatrix |
toRotationMatrix()
Returns a 3D rotation matrix representing this quaternion. |
java.lang.String |
toString()
Returns a string representing the value of this quaternion. |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final Quaternion ONE
public static final Quaternion I
public static final Quaternion J
public static final Quaternion K
Constructor Detail |
---|
public Quaternion(double real, Double3Vector imag)
public Quaternion(double q0, double q1, double q2, double q3)
Method Detail |
---|
public static Quaternion rotation(AbstractDoubleSquareMatrix m)
m
- a rotation matrixpublic AbstractDoubleSquareMatrix toRotationMatrix()
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
obj
- a quaternionpublic java.lang.String toString()
toString
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
public boolean isNaN()
public boolean isInfinite()
public double real()
public Double3Vector imag()
public java.lang.Object getSet()
getSet
in interface Member
public double norm()
norm
in interface BanachSpace.Member
public double sumSquares()
public AbelianGroup.Member negate()
negate
in interface AbelianGroup.Member
public Field.Member inverse()
inverse
in interface Field.Member
public CStarAlgebra.Member involution()
involution
in interface CStarAlgebra.Member
public Quaternion conjugate()
public AbelianGroup.Member add(AbelianGroup.Member x)
add
in interface AbelianGroup.Member
x
- a group memberpublic 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.Member
x
- a group memberpublic 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.Member
x
- a ring memberpublic Ring.Member multiply(Ring.Member x)
multiply
in interface Ring.Member
x
- a ring memberpublic 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.Member
x
- a field memberpublic Field.Member divide(Field.Member x)
divide
in interface Field.Member
x
- a field memberpublic 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 Quaternion normalize()
public static Quaternion exp(Quaternion q)
public static Quaternion log(Quaternion q)
public static Quaternion sin(Quaternion q)
public static Quaternion cos(Quaternion q)
public static Quaternion tan(Quaternion q)
public static Quaternion sinh(Quaternion q)
public static Quaternion cosh(Quaternion q)
public static Quaternion tanh(Quaternion q)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |