public class Quaternion extends Number implements Scalar<Quaternion>, NumberContext.Enforceable<Quaternion>, Access2D<Double>, Transformation2D<Double>, Access2D.Collectable<Double,Mutate2D.Receiver<Double>>
Modifier and Type | Class and Description |
---|---|
static class |
Quaternion.RotationAxis |
static class |
Quaternion.Versor |
Scalar.Factory<N extends Number>
ScalarOperation.Addition<T,N extends Number>, ScalarOperation.Division<T,N extends Number>, ScalarOperation.Multiplication<T,N extends Number>, ScalarOperation.Subtraction<T,N extends Number>
Access2D.Aggregatable<N extends Number>, Access2D.Collectable<N extends Number,R extends Mutate2D.Receiver<N>>, Access2D.Elements, Access2D.ElementView<N extends Number>, Access2D.IndexOf, Access2D.Sliceable<N extends Number>, Access2D.Visitable<N extends Number>
Structure2D.IntRowColumn, Structure2D.Logical<S extends Structure2D,B extends Structure2D.Logical<S,?>>, Structure2D.LongRowColumn, Structure2D.ReducibleTo1D<R extends Structure1D>, Structure2D.RowColumnCallback, Structure2D.RowColumnKey<R,C>, Structure2D.RowColumnMapper<R,C>
Structure1D.BasicMapper<T>, Structure1D.IndexCallback, Structure1D.IndexMapper<T>, Structure1D.IntIndex, Structure1D.LongIndex, Structure1D.LoopCallback
Modifier and Type | Field and Description |
---|---|
static Scalar.Factory<Quaternion> |
FACTORY |
double |
i |
static Quaternion |
I |
static Quaternion |
IJK |
static Quaternion |
INFINITY |
double |
j |
static Quaternion |
J |
double |
k |
static Quaternion |
K |
static Quaternion |
NEG |
static Quaternion |
ONE |
static Quaternion |
TWO |
static Quaternion |
ZERO |
Constructor and Description |
---|
Quaternion() |
Modifier and Type | Method and Description |
---|---|
Quaternion |
add(double arg) |
Quaternion |
add(Quaternion arg) |
double |
angle() |
int |
compareTo(Quaternion reference) |
Quaternion |
conjugate()
This method will (most likely) be moved to some other interface in the future! Just have to figure
out where it fits...
|
long |
count()
count() == countRows() * countColumns()
|
long |
countColumns() |
long |
countRows() |
Quaternion |
divide(double arg) |
Quaternion |
divide(Quaternion arg)
Will calculate
this * reciprocal(arg) which is not the same as
reciprocal(arg) * this . |
double |
doubleValue() |
double |
doubleValue(long index) |
double |
doubleValue(long row,
long col)
Extracts one element of this matrix as a double.
|
Quaternion |
enforce(NumberContext context) |
boolean |
equals(Object obj) |
float |
floatValue() |
Quaternion |
get() |
Double |
get(long index) |
Double |
get(long row,
long col) |
double |
getDeterminant()
The fourth power of the norm of a quaternion is the determinant of the corresponding matrix.
|
Quaternion |
getPureVersor() |
double |
getVectorLength() |
int |
hashCode() |
int |
intValue() |
Quaternion |
invert()
The multiplicative inverse.
|
boolean |
isAbsolute() |
static boolean |
isAbsolute(Quaternion value) |
static boolean |
isInfinite(Quaternion value) |
static boolean |
isNaN(Quaternion value) |
boolean |
isPure() |
boolean |
isReal() |
static boolean |
isReal(Quaternion value) |
boolean |
isSmall(double comparedTo) |
static boolean |
isSmall(double comparedTo,
Quaternion value) |
long |
longValue() |
static Quaternion |
makePolar(double norm,
double[] unit,
double angle) |
static Quaternion.Versor |
makeRotation(Quaternion.RotationAxis axis,
double angle) |
Quaternion |
multiply(double arg) |
Quaternion |
multiply(Quaternion arg) |
Quaternion |
negate()
The additive inverse of this.
|
double |
norm()
this == this.signum().multiply(this.norm()) |
static Quaternion |
of(double i,
double j,
double k) |
static Quaternion |
of(double scalar,
double i,
double j,
double k) |
double |
scalar() |
Quaternion.Versor |
signum()
this == this.signum().multiply(this.norm()) |
Quaternion |
subtract(double arg) |
Quaternion |
subtract(Quaternion arg) |
void |
supplyTo(Mutate2D.Receiver<Double> receiver) |
BigDecimal |
toBigDecimal() |
MatrixStore<ComplexNumber> |
toComplexMatrix() |
MatrixStore<Double> |
toMultiplicationMatrix() |
MatrixStore<Double> |
toMultiplicationVector() |
MatrixStore<Double> |
toRotationMatrix() |
String |
toString() |
String |
toString(NumberContext context) |
<T extends Mutate2D.ModifiableReceiver<Double> & Access2D<Double>> |
transform(T transformable) |
double[] |
unit() |
static Quaternion |
valueOf(double value) |
static Quaternion |
valueOf(Number number) |
PhysicalStore<Double> |
vector() |
Quaternion.Versor |
versor() |
byteValue, shortValue
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
add, divide, multiply, subtract, toPlainString
byteValue, shortValue
asCollectable2D, asPrimitive2D, byteValue, byteValue, columns, elements, equals, floatValue, floatValue, intValue, intValue, longValue, longValue, newPrimitiveColumnCollectable, newPrimitiveRowCollectable, rows, shortValue, shortValue, toRawCopy2D, toString, wrap, wrap
asCollectable1D, asPrimitive1D, axpy, dot, equals, hashCode, nonzeros, supplyTo, toRawCopy1D, toString, wrap, wrap, wrap
collect
column, column, column, column, column, count, index, index, isEmpty, isFat, isScalar, isSquare, isTall, isVector, loopAll, loopColumn, loopColumn, loopDiagonal, loopMatching, loopRow, loopRow, mapperOf, row, row, row, row, row
index, loopAll, loopMatching, loopRange, mapper, size
public static final Scalar.Factory<Quaternion> FACTORY
public static final Quaternion I
public static final Quaternion IJK
public static final Quaternion INFINITY
public static final Quaternion J
public static final Quaternion K
public static final Quaternion NEG
public static final Quaternion ONE
public static final Quaternion TWO
public static final Quaternion ZERO
public final double i
public final double j
public final double k
public static boolean isAbsolute(Quaternion value)
public static boolean isInfinite(Quaternion value)
public static boolean isNaN(Quaternion value)
public static boolean isReal(Quaternion value)
public static boolean isSmall(double comparedTo, Quaternion value)
public static Quaternion makePolar(double norm, double[] unit, double angle)
public static Quaternion.Versor makeRotation(Quaternion.RotationAxis axis, double angle)
public static Quaternion of(double i, double j, double k)
public static Quaternion of(double scalar, double i, double j, double k)
public static Quaternion valueOf(double value)
public static Quaternion valueOf(Number number)
public Quaternion add(double arg)
add
in interface ScalarOperation.Addition<Scalar<Quaternion>,Quaternion>
this + scalarAddend
.public Quaternion add(Quaternion arg)
add
in interface ScalarOperation.Addition<Scalar<Quaternion>,Quaternion>
this + scalarAddend
.public double angle()
public int compareTo(Quaternion reference)
compareTo
in interface Comparable<Quaternion>
public Quaternion conjugate()
VectorSpace
This method will (most likely) be moved to some other interface in the future! Just have to figure out where it fits...
The conjugate transpose of a matrix and/or the conjugate of a scalar/field like ComplexNumber or Quaternion.
The conjugate transpose of a real matrix is simply its transpose.
conjugate
in interface VectorSpace<Scalar<Quaternion>,Quaternion>
public long count()
Structure2D
count
in interface Structure1D
count
in interface Structure2D
public long countColumns()
countColumns
in interface Structure2D
public long countRows()
countRows
in interface Structure2D
public Quaternion divide(double arg)
divide
in interface ScalarOperation.Division<Scalar<Quaternion>,Quaternion>
this / scalarDivisor
.public Quaternion divide(Quaternion arg)
this * reciprocal(arg)
which is not the same as
reciprocal(arg) * this
.divide
in interface ScalarOperation.Division<Scalar<Quaternion>,Quaternion>
this / scalarDivisor
.ScalarOperation.Division.divide(java.lang.Number)
public double doubleValue()
doubleValue
in interface AccessScalar<Quaternion>
doubleValue
in class Number
Number.doubleValue()
public double doubleValue(long index)
doubleValue
in interface Access1D<Double>
doubleValue
in interface Access2D<Double>
public double doubleValue(long row, long col)
Access2D
doubleValue
in interface Access2D<Double>
row
- A row index.col
- A column index.public Quaternion enforce(NumberContext context)
enforce
in interface NumberContext.Enforceable<Quaternion>
public float floatValue()
floatValue
in interface AccessScalar<Quaternion>
floatValue
in class Number
Number.floatValue()
public Quaternion get()
get
in interface AccessScalar<Quaternion>
public Double get(long index)
public double getDeterminant()
public Quaternion getPureVersor()
public double getVectorLength()
public int intValue()
intValue
in interface AccessScalar<Quaternion>
intValue
in class Number
Number.intValue()
public Quaternion invert()
Group.Multiplicative
invert
in interface Group.Multiplicative<Scalar<Quaternion>>
IDENTITY / this
.public boolean isAbsolute()
isAbsolute
in interface Scalar<Quaternion>
Scalar.isAbsolute()
public boolean isPure()
public boolean isReal()
public boolean isSmall(double comparedTo)
isSmall
in interface NormedVectorSpace<Scalar<Quaternion>,Quaternion>
comparedTo
- What to compare withpublic long longValue()
longValue
in interface AccessScalar<Quaternion>
longValue
in class Number
Number.longValue()
public Quaternion multiply(double arg)
multiply
in interface ScalarOperation.Multiplication<Scalar<Quaternion>,Quaternion>
this * scalarMultiplicand
.public Quaternion multiply(Quaternion arg)
multiply
in interface ScalarOperation.Multiplication<Scalar<Quaternion>,Quaternion>
this * multiplicand
.public Quaternion negate()
Group.Additive
negate
in interface Group.Additive<Scalar<Quaternion>>
-this
.public double norm()
NormedVectorSpace
this == this.signum().multiply(this.norm())
norm
in interface NormedVectorSpace<Scalar<Quaternion>,Quaternion>
public double scalar()
public Quaternion.Versor signum()
NormedVectorSpace
this == this.signum().multiply(this.norm())
signum
in interface NormedVectorSpace<Scalar<Quaternion>,Quaternion>
public Quaternion subtract(double arg)
subtract
in interface ScalarOperation.Subtraction<Scalar<Quaternion>,Quaternion>
this - scalarSubtrahend
.public Quaternion subtract(Quaternion arg)
subtract
in interface ScalarOperation.Subtraction<Scalar<Quaternion>,Quaternion>
this - scalarSubtrahend
.public void supplyTo(Mutate2D.Receiver<Double> receiver)
supplyTo
in interface Access2D.Collectable<Double,Mutate2D.Receiver<Double>>
public BigDecimal toBigDecimal()
toBigDecimal
in interface Scalar<Quaternion>
public MatrixStore<ComplexNumber> toComplexMatrix()
public MatrixStore<Double> toMultiplicationMatrix()
public MatrixStore<Double> toMultiplicationVector()
public MatrixStore<Double> toRotationMatrix()
public String toString()
toString
in class Object
Object.toString()
public String toString(NumberContext context)
toString
in interface Scalar<Quaternion>
public <T extends Mutate2D.ModifiableReceiver<Double> & Access2D<Double>> void transform(T transformable)
transform
in interface Transformation2D<Double>
public double[] unit()
public PhysicalStore<Double> vector()
public Quaternion.Versor versor()
Copyright © 2019 Optimatika. All rights reserved.