Documentation of 'mikera.vectorz.Quaternions' Java class
Quaternions
mikera.vectorz

Class Quaternions



  • public class Quaternions
    extends java.lang.Object
    Static functions for quaternion maths, implemented on Vector4 instances Vector4 instance represents (x,y,z,t) tuple, Where: quaternion value = x.i + y.j + z.k + t
    • Method Detail

      • conjugate

        public static Vector4 conjugate(Vector4 a)
        Computes the conjugate of a quaternion
        Parameters:
        a -
        Returns:
      • mul

        public static Vector4 mul(Vector4 a,
                                  Vector4 b)
        Computes the product of two quaternions as a new quaternion
        Parameters:
        a -
        b -
        Returns:
      • rotate

        public static Vector3 rotate(Vector4 a,
                                     Vector3 b)
        Rotates a 3D vector using the given quaternion, returning a new 3D vector
        Parameters:
        q -
        a -
        Returns:
      • axisAngle

        public static Vector4 axisAngle(Vector3 axis,
                                        double angle)
        Create a quaternion that represents a rotation around a given axis vector. The axis vector need not be normalised.
        Parameters:
        axis -
        angle -
        Returns:
      • normalise

        public static Vector4 normalise(Vector4 a)
        Normalises a quaternion
        Parameters:
        a -
        Returns:
      • invert

        public static Vector4 invert(Vector4 a)
        Inverts a quaternion
        Parameters:
        a -
        Returns:

DMelt 3.0 © DataMelt by jWork.ORG

You see the box below because you did not login.