Quaternion

Overview

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

Quaternion.slerp(t, v1, v2) returns a new Quaternion representing spherical linear interpolation between two orientations at interpolation factor t.

This class declares 20 methods for Quaternion objects in TypeScript programs. Available methods include: IDENTITY, concat, conjugate, constructor, dot, equals, eulerAngles, fromAngleAxis, fromEulerAngle, fromRotation, interpolate, inverse, and 4 additional methods. 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)Calls constructor(w, x, y, z) on this Quaternion instance.
constructor(w: number, x: number, y: number, z: number)Calls constructor(w, x, y, z) on this Quaternion instance.
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)QuaternionCalls fromEulerAngle(vec) on this Quaternion instance.
fromEulerAngle(pitch: Vector3 | number, yaw: number, roll: number)QuaternionCalls fromEulerAngle(pitch, yaw, roll) on this Quaternion instance.
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)QuaternionReturns a new Quaternion representing spherical linear interpolation between two orientations at interpolation factor 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

 English