public final class Quaternion extends java.lang.Object implements Field.Member, CStarAlgebra.Member
| Modifier and Type | Field and Description |
|---|---|
static Quaternion |
I |
static Quaternion |
J |
static Quaternion |
K |
static Quaternion |
ONE |
| Constructor and Description |
|---|
Quaternion(double real,
Double3Vector imag)
Constructs a quaternion.
|
Quaternion(double q0,
double q1,
double q2,
double q3)
Constructs the quaternion q0+iq1+jq2+kq3.
|
| Modifier and Type | Method and Description |
|---|---|
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.
|
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.
|
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.
|
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.
|
public static final Quaternion ONE
public static final Quaternion I
public static final Quaternion J
public static final Quaternion K
public Quaternion(double real,
Double3Vector imag)
public Quaternion(double q0,
double q1,
double q2,
double q3)
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 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 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.Memberx - 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.Memberx - a ring memberpublic Ring.Member multiply(Ring.Member x)
multiply in interface Ring.Memberx - 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.Memberx - a field memberpublic Field.Member divide(Field.Member x)
divide in interface Field.Memberx - a field memberpublic Quaternion divide(Quaternion q)
q - a quaternionjava.lang.ArithmeticException - If divide by zero.public Quaternion divide(double x)
x - a real numberjava.lang.ArithmeticException - If divide by zero.