    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.

##

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

##

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

##

Quaternion

     public Quaternion(double real,
                       Double3Vector imag)

  Constructs a quaternion.

Quaternion

     public Quaternion(double q0,
                       double q1,
                       double q2,
                       double q3)

  Constructs the quaternion q0+iq1+jq2+kq3.

##

equals

     public boolean equals(Object obj)

  Compares two quaternions for equality.

  Parameters:
    obj - a quaternion
  Overrides:
    equals in class Object

toString

     public String toString()

  Returns a string representing the value of this quaternion.

  Overrides:
    toString in class Object

hashCode

     public int hashCode()

  Returns a hashcode for this quaternion.

  Overrides:
    hashCode in class Object

isNaN

     public boolean isNaN()

  Returns true if either the real or imaginary part is NaN.

isInfinite

     public boolean isInfinite()

  Returns true if either the real or imaginary part is infinite.

real

     public double real()

  Returns the real part of this quaternion.

imag

     public Double3Vector imag()

  Returns the imaginary part of this quaternion.

mod

     public double mod()

  Returns the modulus of this quaternion.

negate

     public AbelianGroupMember negate()

  Returns the negative of this quaternion.

inverse

     public FieldMember inverse()

  Returns the inverse of this quaternion.

conjugate

     public Quaternion conjugate()

  Returns the conjugate of this quaternion.

add

     public AbelianGroupMember add(AbelianGroupMember x)

  Returns the addition of this number and another.

add

     public Quaternion add(Quaternion q)

  Returns the addition of this quaternion and another.

  Parameters:
    q - a quaternion

addReal

     public Quaternion addReal(double real)

  Returns the addition of this quaternion with a real part.

  Parameters:
    real - a real part

addImag

     public Quaternion addImag(Double3Vector imag)

  Returns the addition of this quaternion with an imaginary part.

  Parameters:
    imag - an imaginary part

subtract

     public AbelianGroupMember subtract(AbelianGroupMember x)

  Returns the subtraction of this number and another.

subtract

     public Quaternion subtract(Quaternion q)

  Returns the subtraction of this quaternion by another.

  Parameters:
    q - a quaternion

subtractReal

     public Quaternion subtractReal(double real)

  Returns the subtraction of this quaternion by a real part.

  Parameters:
    real - a real part

subtractImag

     public Quaternion subtractImag(Double3Vector imag)

  Returns the subtraction of this quaternion by an imaginary part.

  Parameters:
    imag - an imaginary part

multiply

     public RingMember multiply(RingMember x)

  Returns the multiplication of this number and another.

multiply

     public Quaternion multiply(Quaternion q)

  Returns the multiplication of this quaternion and another.

  Parameters:
    q - a quaternion

multiply

     public Quaternion multiply(double x)

  Returns the multiplication of this quaternion by a scalar.

  Parameters:
    x - a real number

divide

     public FieldMember divide(FieldMember x)

  Returns the division of this number and another.

divide

     public Quaternion divide(Quaternion q)

  Returns the division of this quaternion by another.

  Parameters:
    q - a quaternion
  Throws: ArithmeticException
    If divide by zero.

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