Package gov.nasa.worldwind.geom
Class Quaternion
- java.lang.Object
-
- gov.nasa.worldwind.geom.Quaternion
-
public class Quaternion extends java.lang.Object
-
-
Constructor Summary
Constructors Constructor Description Quaternion(double x, double y, double z, double w)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description Quaternion
add(Quaternion quaternion)
Quaternion
divideComponents(double value)
Quaternion
divideComponents(Quaternion quaternion)
double
dot(Quaternion quaternion)
boolean
equals(java.lang.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)
java.lang.String
toString()
double
w()
double
x()
double
y()
double
z()
-
-
-
Field Detail
-
IDENTITY
public static final Quaternion IDENTITY
-
x
public final double x
-
y
public final double y
-
z
public final double z
-
w
public final double w
-
-
Method Detail
-
equals
public final boolean equals(java.lang.Object obj)
- Overrides:
equals
in classjava.lang.Object
-
hashCode
public final int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
fromArray
public static Quaternion fromArray(double[] compArray, int offset)
-
toArray
public final double[] toArray(double[] compArray, int offset)
-
toString
public final java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
getX
public final double getX()
-
getY
public final double getY()
-
getZ
public final double getZ()
-
getW
public final double getW()
-
x
public final double x()
-
y
public final double y()
-
z
public final double z()
-
w
public final double w()
-
fromAxisAngle
public static Quaternion fromAxisAngle(Angle angle, Vec4 axis)
-
fromAxisAngle
public static Quaternion fromAxisAngle(Angle angle, double axisX, double axisY, double axisZ)
-
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 callinggetRotationX()
,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.
-
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 callinggetLatLon()
.- Parameters:
latitude
- Angle rotation of latitude.longitude
- Angle rotation of longitude.- Returns:
- Quaternion representing combined latitude and longitude rotation.
-
add
public final Quaternion add(Quaternion quaternion)
-
subtract
public final Quaternion subtract(Quaternion quaternion)
-
multiplyComponents
public final Quaternion multiplyComponents(double value)
-
multiply
public final Quaternion multiply(Quaternion quaternion)
-
divideComponents
public final Quaternion divideComponents(double value)
-
divideComponents
public final Quaternion divideComponents(Quaternion quaternion)
-
getConjugate
public final Quaternion getConjugate()
-
getNegative
public final Quaternion getNegative()
-
getLength
public final double getLength()
-
getLengthSquared
public final double getLengthSquared()
-
normalize
public final Quaternion normalize()
-
dot
public final double dot(Quaternion quaternion)
-
getInverse
public final Quaternion getInverse()
-
mix
public static Quaternion mix(double amount, Quaternion value1, Quaternion value2)
-
slerp
public static Quaternion slerp(double amount, Quaternion value1, Quaternion value2)
-
getAngle
public final Angle getAngle()
-
getAxis
public final Vec4 getAxis()
-
getRotationX
public final Angle getRotationX()
-
getRotationY
public final Angle getRotationY()
-
getRotationZ
public final Angle getRotationZ()
-
getLatLon
public final LatLon getLatLon()
-
-