All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class cynosurex.math.Quaternion

java.lang.Object
   |
   +----cynosurex.math.Quaternion

public class Quaternion
extends Object
implements CommonInterface

Variable Index

 o w
 o x
 o y
 o z

Constructor Index

 o Quaternion(double, double, double, double)
Constructor to create a Quaternion.
 o Quaternion(double, double[])
Constructor to create a Quaternion from a vector array.
 o Quaternion(double, Vector)
Constructor to create a Quaternion from a Vector.

Method Index

 o addition(Quaternion, Quaternion)
Static method to add two Quaternions together.
 o conjugate()
Conjugates the current Quaternion.
 o getAngle()
Returns the angle this Quaternion represents.
 o getConjugate()
Returns the conjugate of the Quaternion.
 o getMagnitude()
Returns the magnitude of the Quaternion.
 o getS()
Returns the scalar component (same as w) of the Quaternion.
 o getVector()
Returns the Vector component of the Quaternion.
 o getW()
Returns the w component of the Quaternion.
 o getX()
Returns the x component of the Quaternion.
 o getY()
Returns the y component of the Quaternion.
 o getZ()
Returns the z component of the Quaternion.
 o product(Quaternion, Quaternion)
Static method to calculate the product of two Quaternions.
 o toString()
Overrides the super class method.

Variables

 o w
 protected double w
 o x
 protected double x
 o y
 protected double y
 o z
 protected double z

Constructors

 o Quaternion
 public Quaternion(double w,
                   double x,
                   double y,
                   double z)
Constructor to create a Quaternion. q = w + xi + yj + zk

 o Quaternion
 public Quaternion(double s,
                   Vector v)
Constructor to create a Quaternion from a Vector. q = (s, v)

Parameters:
s - scalar value (same as w)
v - vector with three dimensions
 o Quaternion
 public Quaternion(double s,
                   double v[])
Constructor to create a Quaternion from a vector array.

Parameters:
s - scalar value (same as w)
v - array with three elements

Methods

 o addition
 public static Quaternion addition(Quaternion q1,
                                   Quaternion q2)
Static method to add two Quaternions together.

Parameters:
q1 - Quaternion 1
q2 - Quaternion 2
 o product
 public static Quaternion product(Quaternion q1,
                                  Quaternion q2)
Static method to calculate the product of two Quaternions.

Parameters:
q1 - Quaternion 1
q2 - Quaternion 2
 o getAngle
 public Angle getAngle()
Returns the angle this Quaternion represents.

 o getW
 public double getW()
Returns the w component of the Quaternion.

 o getS
 public double getS()
Returns the scalar component (same as w) of the Quaternion.

 o getX
 public double getX()
Returns the x component of the Quaternion.

 o getY
 public double getY()
Returns the y component of the Quaternion.

 o getZ
 public double getZ()
Returns the z component of the Quaternion.

 o getVector
 public Vector getVector()
Returns the Vector component of the Quaternion.

 o getMagnitude
 public double getMagnitude()
Returns the magnitude of the Quaternion.

 o getConjugate
 public Quaternion getConjugate()
Returns the conjugate of the Quaternion.

 o conjugate
 public void conjugate()
Conjugates the current Quaternion.

 o toString
 public String toString()
Overrides the super class method.

Overrides:
toString in class Object

All Packages  Class Hierarchy  This Package  Previous  Next  Index