All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class JSci.maths.Quaternion

java.lang.Object
   |
   +----JSci.maths.Quaternion

public final class Quaternion
extends Object
implements FieldMember, Serializable
The Quaternion class encapsulates quaternions.


Constructor Index

 o Quaternion(double, double, double, double)
Constructs the quaternion q0+iq1+jq2+kq3.
 o Quaternion(double, Double3Vector)
Constructs a quaternion.

Method Index

 o add(AbelianGroupMember)
Returns the addition of this number and another.
 o add(Quaternion)
Returns the addition of this quaternion and another.
 o addImag(Double3Vector)
Returns the addition of this quaternion with an imaginary part.
 o addReal(double)
Returns the addition of this quaternion with a real part.
 o conjugate()
Returns the conjugate of this quaternion.
 o divide(double)
Returns the division of this quaternion by a scalar.
 o divide(FieldMember)
Returns the division of this number and another.
 o divide(Quaternion)
Returns the division of this quaternion by another.
 o equals(Object)
Compares two quaternions for equality.
 o hashCode()
Returns a hashcode for this quaternion.
 o imag()
Returns the imaginary part of this quaternion.
 o inverse()
Returns the inverse of this quaternion.
 o isInfinite()
Returns true if either the real or imaginary part is infinite.
 o isNaN()
Returns true if either the real or imaginary part is NaN.
 o mod()
Returns the modulus of this quaternion.
 o multiply(double)
Returns the multiplication of this quaternion by a scalar.
 o multiply(Quaternion)
Returns the multiplication of this quaternion and another.
 o multiply(RingMember)
Returns the multiplication of this number and another.
 o negate()
Returns the negative of this quaternion.
 o real()
Returns the real part of this quaternion.
 o subtract(AbelianGroupMember)
Returns the subtraction of this number and another.
 o subtract(Quaternion)
Returns the subtraction of this quaternion by another.
 o subtractImag(Double3Vector)
Returns the subtraction of this quaternion by an imaginary part.
 o subtractReal(double)
Returns the subtraction of this quaternion by a real part.
 o toString()
Returns a string representing the value of this quaternion.

Constructors

 o Quaternion
 public Quaternion(double real,
                   Double3Vector imag)
Constructs a quaternion.

 o Quaternion
 public Quaternion(double q0,
                   double q1,
                   double q2,
                   double q3)
Constructs the quaternion q0+iq1+jq2+kq3.

Methods

 o equals
 public boolean equals(Object obj)
Compares two quaternions for equality.

Parameters:
obj - a quaternion
Overrides:
equals in class Object
 o toString
 public String toString()
Returns a string representing the value of this quaternion.

Overrides:
toString in class Object
 o hashCode
 public int hashCode()
Returns a hashcode for this quaternion.

Overrides:
hashCode in class Object
 o isNaN
 public boolean isNaN()
Returns true if either the real or imaginary part is NaN.

 o isInfinite
 public boolean isInfinite()
Returns true if either the real or imaginary part is infinite.

 o real
 public double real()
Returns the real part of this quaternion.

 o imag
 public Double3Vector imag()
Returns the imaginary part of this quaternion.

 o mod
 public double mod()
Returns the modulus of this quaternion.

 o negate
 public AbelianGroupMember negate()
Returns the negative of this quaternion.

 o inverse
 public FieldMember inverse()
Returns the inverse of this quaternion.

 o conjugate
 public Quaternion conjugate()
Returns the conjugate of this quaternion.

 o add
 public AbelianGroupMember add(AbelianGroupMember x)
Returns the addition of this number and another.

 o add
 public Quaternion add(Quaternion q)
Returns the addition of this quaternion and another.

Parameters:
q - a quaternion
 o addReal
 public Quaternion addReal(double real)
Returns the addition of this quaternion with a real part.

Parameters:
real - a real part
 o addImag
 public Quaternion addImag(Double3Vector imag)
Returns the addition of this quaternion with an imaginary part.

Parameters:
imag - an imaginary part
 o subtract
 public AbelianGroupMember subtract(AbelianGroupMember x)
Returns the subtraction of this number and another.

 o subtract
 public Quaternion subtract(Quaternion q)
Returns the subtraction of this quaternion by another.

Parameters:
q - a quaternion
 o subtractReal
 public Quaternion subtractReal(double real)
Returns the subtraction of this quaternion by a real part.

Parameters:
real - a real part
 o subtractImag
 public Quaternion subtractImag(Double3Vector imag)
Returns the subtraction of this quaternion by an imaginary part.

Parameters:
imag - an imaginary part
 o multiply
 public RingMember multiply(RingMember x)
Returns the multiplication of this number and another.

 o multiply
 public Quaternion multiply(Quaternion q)
Returns the multiplication of this quaternion and another.

Parameters:
q - a quaternion
 o multiply
 public Quaternion multiply(double x)
Returns the multiplication of this quaternion by a scalar.

Parameters:
x - a real number
 o divide
 public FieldMember divide(FieldMember x)
Returns the division of this number and another.

 o divide
 public Quaternion divide(Quaternion q)
Returns the division of this quaternion by another.

Parameters:
q - a quaternion
Throws: ArithmeticException
If divide by zero.
 o divide
 public Quaternion divide(double x)
Returns the division of this quaternion by a scalar.

Parameters:
x - a real number
Throws: ArithmeticException
If divide by zero.

All Packages  Class Hierarchy  This Package  Previous  Next  Index