Class Quaternion


  • public class Quaternion
    extends java.lang.Object
    • 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
    • Constructor Detail

      • Quaternion

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

      • equals

        public final boolean equals​(java.lang.Object obj)
        Overrides:
        equals in class java.lang.Object
      • hashCode

        public final int hashCode()
        Overrides:
        hashCode in class java.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 class java.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,
                                               double axisX,
                                               double axisY,
                                               double axisZ)
      • 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.
      • 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.
      • multiplyComponents

        public final Quaternion multiplyComponents​(double value)
      • divideComponents

        public final Quaternion divideComponents​(double value)
      • getConjugate

        public final Quaternion getConjugate()
      • getNegative

        public final Quaternion getNegative()
      • getLength

        public final double getLength()
      • getLengthSquared

        public final double getLengthSquared()
      • dot

        public final double dot​(Quaternion quaternion)
      • getInverse

        public final Quaternion getInverse()
      • 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()