Home

# Library goog.vec.Quaternion

Function Summary
| `concat(?goog.vec.Quaternion.AnyType quat0, ?goog.vec.Quaternion.AnyType quat1, ?goog.vec.Quaternion.AnyType resultQuat) ⇒ !goog.vec.Quaternion.AnyType` Concatenates the two quaternions storing the result into resultQuat.
| `conjugate(?goog.vec.Quaternion.AnyType quat, ?goog.vec.Quaternion.AnyType resultQuat) ⇒ !goog.vec.Quaternion.AnyType` Computes the conjugate of the quaternion in quat storing the result into resultQuat.
| `fromAngleAxis(number angle, ?goog.vec.Quaternion.AnyType axis, ?goog.vec.Quaternion.AnyType quat) ⇒ ?goog.vec.Quaternion.AnyType` Generates a unit quaternion from the given angle-axis rotation pair. The rotation axis is not required to be a unit vector, but should have non-zero length. The angle should be specified in radians.
| `fromRotationMatrix4(?goog.vec.Quaternion.AnyType matrix, ?goog.vec.Quaternion.AnyType quat) ⇒ !goog.vec.Quaternion.AnyType` Generates the quaternion from the given rotation matrix.
| `slerp(?goog.vec.Quaternion.AnyType q0, ?goog.vec.Quaternion.AnyType q1, number t, ?goog.vec.Quaternion.AnyType resultQuat) ⇒ ?goog.vec.Quaternion.AnyType` Computes the spherical linear interpolated value from the given quaternions q0 and q1 according to the coefficient t. The resulting quaternion is stored in resultQuat.

`toAngleAxis(?goog.vec.Quaternion.AnyType quat, ?goog.vec.Quaternion.AnyType axis) ⇒ number`

Generates an angle-axis rotation pair from a unit quaternion. The quaternion is assumed to be of unit length. The calculated values are returned via the passed 'axis' object and the 'angle' number returned by the function itself. The returned rotation axis is a non-zero length unit vector, and the returned angle is in radians in the range of [-PI, +PI].

| `toRotationMatrix4(?goog.vec.Quaternion.AnyType quat, ?goog.vec.AnyType matrix) ⇒ !goog.vec.AnyType` Generates the rotation matrix from the given quaternion.