|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.vizzini.math.Quaternion
public final class Quaternion
Provides a quaternion for handling coordinate transformations. Instances of this class are immutable.
Field Summary | |
---|---|
static Quaternion |
ZERO
Zero quaternion. |
Constructor Summary | |
---|---|
Quaternion(double rightAscension,
double declination)
Construct this object using the given parameters. |
|
Quaternion(double x,
double y,
double z,
double q)
Construct this object with the given parameters. |
|
Quaternion(Vector v,
double angle)
Construct this object with the given parameters. |
Method Summary | |
---|---|
Quaternion |
conjugate()
Return a new Quaternion which is the conjugate of this. |
boolean |
equals(Object object)
Return true if this vector equals the given object. |
boolean |
equals(Object object,
double delta)
Return true if this vector equals the given object with the given precision. |
double |
getAngle()
Return the rotation angle in radians. |
double |
getMagnitude()
Return the magnitude of this. |
double |
getQ()
Return the Q component. |
Vector |
getVector()
Return the rotation vector. |
double |
getX()
Return the X component. |
double |
getY()
Return the Y component. |
double |
getZ()
Return the Z component. |
int |
hashCode()
Return a hash code. |
Quaternion |
multiply(Quaternion q)
Return a new Quaternion which is the result of multiplying this times the given quaternion. |
Quaternion |
opposite()
Return a new Quaterion that represents the opposite direction to this. |
static Quaternion |
parseQuaternion(String quaternionString)
Parse the given string into a Quaternion. |
Vector |
postMultiply(Vector v)
Return a new Vector which is the result of multiplying the given vector with this quaternion. |
Vector |
preMultiply(Vector v)
Return a new Vector which is the result of multiplying this quaternion with the given vector. |
Quaternion |
subtract(Quaternion q0)
Return a new quaterion which is the difference between this and the given quaternion. |
String |
toRotationString()
Return a string representation of this object using the rotation vector and rotation angle. |
String |
toString()
Return a string representation of this object. |
Quaternion |
unit()
Return a new unitized instance of this. |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final Quaternion ZERO
Constructor Detail |
---|
public Quaternion(Vector v, double angle)
v
- Rotation axis.angle
- Rotation angle in radians.public Quaternion(double rightAscension, double declination)
public Quaternion(double x, double y, double z, double q)
Method Detail |
---|
public static Quaternion parseQuaternion(String quaternionString)
public Quaternion conjugate()
public boolean equals(Object object)
equals
in class Object
object
- Object to compare.public boolean equals(Object object, double delta)
object
- Object to compare.delta
- Allowable difference in coordinates.public double getAngle()
public double getMagnitude()
public double getQ()
public Vector getVector()
public double getX()
public double getY()
public double getZ()
public int hashCode()
hashCode
in class Object
public Quaternion multiply(Quaternion q)
public Quaternion opposite()
public Vector postMultiply(Vector v)
public Vector preMultiply(Vector v)
public Quaternion subtract(Quaternion q0)
public String toRotationString()
public String toString()
toString
in class Object
public Quaternion unit()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Copyright © 2007 Vizzini.org. All Rights Reserved. | 2007.12.25.03.00.02 |