Quaternion

Overview

Quaternion is a class in Aspose.3D FOSS for Typescript.

Quaternion.constructor creates a quaternion with default component values.

This class provides 16 methods for working with Quaternion objects in Typescript programs. Available methods include: IDENTITY, concat, conjugate, constructor, dot, equals, eulerAngles, fromAngleAxis, fromEulerAngle, fromRotation, interpolate, inverse, and 4 additional methods. All public members are accessible to any Typescript application after installing the Aspose.3D FOSS for Typescript package. Properties: length, w, x, y, z.

Properties

NameTypeAccessDescription
wnumberRead/WriteGets the w.
xnumberRead/WriteGets the x.
ynumberRead/WriteGets the y.
znumberRead/WriteGets the z.
lengthnumberReadGets the length.

Methods

SignatureDescription
constructor()Initializes a quaternion with the given w, x, y, and z components
constructor(w: number, x: number, y: number, z: number)
constructor(w: number, x: number, y: number, z: number)
IDENTITY()QuaternionReturns the identity quaternion representing no rotation
normalize()QuaternionReturns a unit‑length version of this quaternion
conjugate()QuaternionReturns the conjugate of the quaternion
inverse()QuaternionReturns the multiplicative inverse of the quaternion
dot(q: Quaternion)numberComputes the dot product with another quaternion
concat(rhs: Quaternion)QuaternionReturns the concatenation (multiplication) of this quaternion with another
eulerAngles()Vector3Returns a Vector3 of Euler angles representing the rotation
fromEulerAngle(pitch: number, yaw: number, roll: number)QuaternionOverload accepts a Vector3 or numeric pitch with yaw and roll
fromEulerAngle(vec: Vector3)Quaternion
fromEulerAngle(pitch: Vector3 | number, yaw: number, roll: number)Quaternion
fromAngleAxis(a: number, axis: Vector3)QuaternionCreates a quaternion from a rotation angle and axis vector
fromRotation(orig: Vector3, dest: Vector3)QuaternionBuilds a quaternion that rotates from one direction vector to another
interpolate(t: number, fromQ: Quaternion, toQ: Quaternion)QuaternionLinearly interpolates between two quaternions using parameter t
slerp(t: number, v1: Quaternion, v2: Quaternion)QuaternionPerforms spherical linear interpolation between two quaternions at t
toString()stringReturns a string representation of the quaternion components
equals(other: Quaternion)booleanChecks whether another quaternion has identical component values
toMatrix()Matrix4Converts the quaternion into a 4×4 rotation matrix

See Also