All Packages Class Hierarchy This Package Previous Next Index
Class cynosurex.math.Quaternion
java.lang.Object
|
+----cynosurex.math.Quaternion
- public class Quaternion
- extends Object
-
w
-
-
x
-
-
y
-
-
z
-
-
Quaternion(double, double, double, double)
- Constructor to create a Quaternion.
-
Quaternion(double, double[])
- Constructor to create a Quaternion from a vector array.
-
Quaternion(double, Vector)
- Constructor to create a Quaternion from a Vector.
-
addition(Quaternion, Quaternion)
- Static method to add two Quaternions together.
-
conjugate()
- Conjugates the current Quaternion.
-
getAngle()
- Returns the angle this Quaternion represents.
-
getConjugate()
- Returns the conjugate of the Quaternion.
-
getMagnitude()
- Returns the magnitude of the Quaternion.
-
getS()
- Returns the scalar component (same as w) of the Quaternion.
-
getVector()
- Returns the Vector component of the Quaternion.
-
getW()
- Returns the w component of the Quaternion.
-
getX()
- Returns the x component of the Quaternion.
-
getY()
- Returns the y component of the Quaternion.
-
getZ()
- Returns the z component of the Quaternion.
-
product(Quaternion, Quaternion)
- Static method to calculate the product of two Quaternions.
-
toString()
- Overrides the super class method.
w
protected double w
x
protected double x
y
protected double y
z
protected double z
Quaternion
public Quaternion(double w,
double x,
double y,
double z)
- Constructor to create a Quaternion. q = w + xi + yj + zk
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
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
addition
public static Quaternion addition(Quaternion q1,
Quaternion q2)
- Static method to add two Quaternions together.
- Parameters:
- q1 - Quaternion 1
- q2 - Quaternion 2
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
getAngle
public Angle getAngle()
- Returns the angle this Quaternion represents.
getW
public double getW()
- Returns the w component of the Quaternion.
getS
public double getS()
- Returns the scalar component (same as w) of the Quaternion.
getX
public double getX()
- Returns the x component of the Quaternion.
getY
public double getY()
- Returns the y component of the Quaternion.
getZ
public double getZ()
- Returns the z component of the Quaternion.
getVector
public Vector getVector()
- Returns the Vector component of the Quaternion.
getMagnitude
public double getMagnitude()
- Returns the magnitude of the Quaternion.
getConjugate
public Quaternion getConjugate()
- Returns the conjugate of the Quaternion.
conjugate
public void conjugate()
- Conjugates the current Quaternion.
toString
public String toString()
- Overrides the super class method.
- Overrides:
- toString in class Object
All Packages Class Hierarchy This Package Previous Next Index