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 Quaternionadd(Quaternion quaternion)QuaterniondivideComponents(double value)QuaterniondivideComponents(Quaternion quaternion)doubledot(Quaternion quaternion)booleanequals(java.lang.Object obj)static QuaternionfromArray(double[] compArray, int offset)static QuaternionfromAxisAngle(Angle angle, double axisX, double axisY, double axisZ)static QuaternionfromAxisAngle(Angle angle, Vec4 axis)static QuaternionfromLatLon(Angle latitude, Angle longitude)Returns a Quaternion created from latitude and longitude rotations.static QuaternionfromMatrix(Matrix matrix)static QuaternionfromRotationXYZ(Angle x, Angle y, Angle z)Returns a Quaternion created from three Euler angle rotations.AnglegetAngle()Vec4getAxis()QuaterniongetConjugate()QuaterniongetInverse()LatLongetLatLon()doublegetLength()doublegetLengthSquared()QuaterniongetNegative()AnglegetRotationX()AnglegetRotationY()AnglegetRotationZ()doublegetW()doublegetX()doublegetY()doublegetZ()inthashCode()static Quaternionmix(double amount, Quaternion value1, Quaternion value2)Quaternionmultiply(Quaternion quaternion)QuaternionmultiplyComponents(double value)Quaternionnormalize()static Quaternionslerp(double amount, Quaternion value1, Quaternion value2)Quaternionsubtract(Quaternion quaternion)double[]toArray(double[] compArray, int offset)java.lang.StringtoString()doublew()doublex()doubley()doublez()
-
-
-
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:
equalsin classjava.lang.Object
-
hashCode
public final int hashCode()
- Overrides:
hashCodein 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:
toStringin 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()
-
-