|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectuavsim.flightdynamicsmodel.Quaternion
public class Quaternion
Defines a general-purpose mathematical quaternion as an alternative to Euler angles for attitude calculations without singularity limitations at extreme configurations. It is derived from Physics for Game Developers by David Bourg.
| Field Summary | |
|---|---|
private double |
_n
the scalar component |
private Vector |
_v
the vector component |
| Constructor Summary | |
|---|---|
Quaternion()
Creates a quaternion with the scalar and vector components zero. |
|
Quaternion(double roll,
double pitch,
double yaw)
Creates a quaternion from the Euler angles (in degrees). |
|
Quaternion(double n,
double x,
double y,
double z)
Creates a quaternion from its individual elements. |
|
Quaternion(double n,
Vector vector)
Creates a quaternion from its individual elements. |
|
| Method Summary | |
|---|---|
Quaternion |
add(Quaternion quaternion)
Calculates the sum of this quaternion and another. |
Quaternion |
clone()
|
Quaternion |
conjugate()
Calculates the conjugate of this quaternion. |
Vector |
convertToEulerAngles()
Converts this quaternion to a vector of Euler angles. |
Quaternion |
divide(double scale)
Calculates the scaled components of this quaternion. |
double |
getAngle()
Calculates the angle component of this quaternion from its scalar component. |
Vector |
getAxis()
Calculates the vector axis of this quaternion. |
double |
getScalar()
Returns the scalar component of this quaternion. |
Vector |
getVector()
Returns a copy of the vector component of this quaternion. |
double |
magnitude()
Calculates the magnitude of this quaternion. |
Quaternion |
multiply(double scale)
Calculates the scaled components of this quaternion. |
Quaternion |
multiply(Quaternion quaternion)
Calculates the product of this quaternion and another. |
Quaternion |
multiply(Vector vector)
Calculates the product of this quaternion and a vector. |
Quaternion |
rotate(Quaternion quaternion)
Rotates this quaternion with respect to another. |
Vector |
rotate(Vector vector)
Rotates this quaternion with respect to a vector. |
Quaternion |
subtract(Quaternion quaternion)
Calculates the difference of this quaternion and another. |
| Methods inherited from class java.lang.Object |
|---|
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
private final double _n
private Vector _v
| Constructor Detail |
|---|
public Quaternion()
public Quaternion(double roll,
double pitch,
double yaw)
roll - - the rollpitch - - the pitchyaw - - the yaw
public Quaternion(double n,
double x,
double y,
double z)
n - - the scalar componentx - - the x component of the vectory - - the y component of the vectorz - - the z component of the vector
public Quaternion(double n,
Vector vector)
n - - the scalar componentvector - - the vector component| Method Detail |
|---|
public Quaternion add(Quaternion quaternion)
quaternion - - the other quaternion
public Quaternion clone()
clone in class java.lang.Objectpublic Quaternion conjugate()
public Vector convertToEulerAngles()
public Quaternion divide(double scale)
scale - - the scale
public double getAngle()
public Vector getAxis()
public double getScalar()
public Vector getVector()
public double magnitude()
public Quaternion multiply(double scale)
scale - - the scale
public Quaternion multiply(Quaternion quaternion)
quaternion - - the other quaternion
public Quaternion multiply(Vector vector)
vector - - the vector
public Quaternion rotate(Quaternion quaternion)
quaternion - - the other quaternion
public Vector rotate(Vector vector)
vector - - the other vector
public Quaternion subtract(Quaternion quaternion)
quaternion - - the other quaternion
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||