NASA World Wind

gov.nasa.worldwind.geom
Class Quaternion

java.lang.Object
  extended by gov.nasa.worldwind.geom.Quaternion

public class Quaternion
extends Object


Field Summary
static Quaternion IDENTITY
           
 double w
           
 double x
           
 double y
           
 double z
           
 
Constructor Summary
Quaternion(double x, double y, double z, double w)
           
 
Method Summary
 Quaternion add(Quaternion quaternion)
           
 Quaternion divideComponents(double value)
           
 Quaternion divideComponents(Quaternion quaternion)
           
 double dot(Quaternion quaternion)
           
 boolean equals(Object obj)
           
static Quaternion fromArray(double[] compArray, int offset)
           
static Quaternion fromAxisAngle(Angle angle, double axisX, double axisY, double axisZ)
           
static Quaternion fromAxisAngle(Angle angle, Vec4 axis)
           
static Quaternion fromLatLon(Angle latitude, Angle longitude)
          Returns a Quaternion created from latitude and longitude rotations.
static Quaternion fromMatrix(Matrix matrix)
           
static Quaternion fromRotationXYZ(Angle x, Angle y, Angle z)
          Returns a Quaternion created from three Euler angle rotations.
 Angle getAngle()
           
 Vec4 getAxis()
           
 Quaternion getConjugate()
           
 Quaternion getInverse()
           
 LatLon getLatLon()
           
 double getLength()
           
 double getLengthSquared()
           
 Quaternion getNegative()
           
 Angle getRotationX()
           
 Angle getRotationY()
           
 Angle getRotationZ()
           
 double getW()
           
 double getX()
           
 double getY()
           
 double getZ()
           
 int hashCode()
           
static Quaternion mix(double amount, Quaternion value1, Quaternion value2)
           
 Quaternion multiply(Quaternion quaternion)
           
 Quaternion multiplyComponents(double value)
           
 Quaternion normalize()
           
static Quaternion slerp(double amount, Quaternion value1, Quaternion value2)
           
 Quaternion subtract(Quaternion quaternion)
           
 double[] toArray(double[] compArray, int offset)
           
 String toString()
           
 double w()
           
 double x()
           
 double y()
           
 double z()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

IDENTITY

public static final Quaternion IDENTITY

w

public final double w

x

public final double x

y

public final double y

z

public final double z
Constructor Detail

Quaternion

public Quaternion(double x,
                  double y,
                  double z,
                  double w)
Method Detail

add

public final Quaternion add(Quaternion quaternion)

divideComponents

public final Quaternion divideComponents(double value)

divideComponents

public final Quaternion divideComponents(Quaternion quaternion)

dot

public final double dot(Quaternion quaternion)

equals

public final boolean equals(Object obj)
Overrides:
equals in class Object

fromArray

public static Quaternion fromArray(double[] compArray,
                                   int offset)

fromAxisAngle

public static Quaternion fromAxisAngle(Angle angle,
                                       double axisX,
                                       double axisY,
                                       double axisZ)

fromAxisAngle

public static Quaternion fromAxisAngle(Angle angle,
                                       Vec4 axis)

fromLatLon

public static Quaternion fromLatLon(Angle latitude,
                                    Angle longitude)
Returns a Quaternion created from latitude and longitude rotations. Latitude and longitude can be extracted from a Quaternion by calling getLatLon().

Parameters:
latitude - Angle rotation of latitude.
longitude - Angle rotation of longitude.
Returns:
Quaternion representing combined latitude and longitude rotation.

fromMatrix

public static Quaternion fromMatrix(Matrix matrix)

fromRotationXYZ

public static Quaternion fromRotationXYZ(Angle x,
                                         Angle y,
                                         Angle z)
Returns a Quaternion created from three Euler angle rotations. The angles represent rotation about their respective unit-axes. The angles are applied in the order X, Y, Z. Angles can be extracted by calling getRotationX(), getRotationY(), getRotationZ().

Parameters:
x - Angle rotation about unit-X axis.
y - Angle rotation about unit-Y axis.
z - Angle rotation about unit-Z axis.
Returns:
Quaternion representation of the combined X-Y-Z rotation.

getAngle

public final Angle getAngle()

getAxis

public final Vec4 getAxis()

getConjugate

public final Quaternion getConjugate()

getInverse

public final Quaternion getInverse()

getLatLon

public final LatLon getLatLon()

getLength

public final double getLength()

getLengthSquared

public final double getLengthSquared()

getNegative

public final Quaternion getNegative()

getRotationX

public final Angle getRotationX()

getRotationY

public final Angle getRotationY()

getRotationZ

public final Angle getRotationZ()

getW

public final double getW()

getX

public final double getX()

getY

public final double getY()

getZ

public final double getZ()

hashCode

public final int hashCode()
Overrides:
hashCode in class Object

mix

public static Quaternion mix(double amount,
                             Quaternion value1,
                             Quaternion value2)

multiply

public final Quaternion multiply(Quaternion quaternion)

multiplyComponents

public final Quaternion multiplyComponents(double value)

normalize

public final Quaternion normalize()

slerp

public static Quaternion slerp(double amount,
                               Quaternion value1,
                               Quaternion value2)

subtract

public final Quaternion subtract(Quaternion quaternion)

toArray

public final double[] toArray(double[] compArray,
                              int offset)

toString

public final String toString()
Overrides:
toString in class Object

w

public final double w()

x

public final double x()

y

public final double y()

z

public final double z()

NASA World Wind