|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectedu.nps.moves.math.Quaternion2
public class Quaternion2
The Quaternion2 class executes quaternion operations.
| Constructor Summary | |
|---|---|
Quaternion2()
Default constructor |
|
Quaternion2(java.lang.String myName)
Default constructor |
|
Quaternion2(java.lang.String myName,
double ww,
double xx,
double yy,
double zz)
Default constructor |
|
| Method Summary | |
|---|---|
Quaternion2 |
add(Quaternion2 QUAT)
Adds two quaternions |
double |
dotProduct(Quaternion2 QUAT5)
Finds the dot product of two quaternions |
double |
getW()
Returns the w value of quaternion. |
double |
getX()
Returns the x value of quaternion. |
double |
getY()
Returns the y value of quaternion. |
double |
getZ()
Returns the z value of quaternion. |
Quaternion2 |
invert()
Finds the inverse (conjugate) of a quaternion |
static void |
main(java.lang.String[] ags)
Main method for testing |
Quaternion2 |
multiply(double NUM)
Multiplies this quaternion with a scalar |
Quaternion2 |
multiply(Quaternion2 QUAT)
Multiplies two quaternions |
void |
normalize()
Normalizes the quaternion modifies the current quaternion |
Quaternion2 |
rotate(Quaternion2 QUAT4)
Rotates a vector by quaternions |
void |
setQuaternion2(double ww,
double xx,
double yy,
double zz)
Sets the quaternion values |
Quaternion2 |
substract(Quaternion2 QUAT)
Substracts two quaternions |
Quaternion2 |
toAxisAngles()
Calculates the axis angles of quaternion for drawing, results must be used in glRotatef() by using get() functions |
Quaternion2 |
toBody(Quaternion2 QUAT)
Converts to body coordinates |
Quaternion2 |
toEulerAngles()
Converts a quaternion into Euler angles Warning : This conversion is inherently ill-defined |
float[] |
toFloat()
Converts quaternion's values into float |
Quaternion2 |
toQuaternion2()
Calculates the quaternion value of three rotations Current object is a 3D vector with rotation angles in quaternion form |
java.lang.String |
toString()
Overrides the toString method |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public Quaternion2(java.lang.String myName,
double ww,
double xx,
double yy,
double zz)
myName - Name of the quaternionww - w value of the quaternionxx - x value of the quaternionyy - y value of the quaternionzz - z value of the quaternionpublic Quaternion2(java.lang.String myName)
myName - Name of the quaternionpublic Quaternion2()
| Method Detail |
|---|
public void setQuaternion2(double ww,
double xx,
double yy,
double zz)
ww - w value of the quaternionxx - x value of the quaternionyy - y value of the quaternionzz - z value of the quaternionpublic double getW()
public double getX()
public double getY()
public double getZ()
public Quaternion2 multiply(Quaternion2 QUAT)
QUAT - second quaternion
public Quaternion2 multiply(double NUM)
NUM - is a scalar
public Quaternion2 add(Quaternion2 QUAT)
QUAT - is a quaternion to add
public Quaternion2 substract(Quaternion2 QUAT)
QUAT - is a quaternion to substract
public Quaternion2 invert()
public Quaternion2 rotate(Quaternion2 QUAT4)
QUAT4 - a vector in quaternion form
public Quaternion2 toBody(Quaternion2 QUAT)
QUAT - a vector in quaternion form to convert to body coordinates
public double dotProduct(Quaternion2 QUAT5)
QUAT5 - a quaternion
public void normalize()
public Quaternion2 toAxisAngles()
public Quaternion2 toQuaternion2()
public Quaternion2 toEulerAngles()
public java.lang.String toString()
toString in class java.lang.Objectpublic float[] toFloat()
public static void main(java.lang.String[] ags)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||