Companion

Properties

Link copied to clipboard

An immutable Quaternion instance initialized to (0.0, 0.0, 0.0, 1.0).

Link copied to clipboard

The number of elements used to store the object into an array in its interpolatable form.

Link copied to clipboard
open override val packedLength: Int

The number of elements used to pack the object into an array.

Link copied to clipboard

An immutable Quaternion instance initialized to (0.0, 0.0, 0.0, 0.0).

Functions

Link copied to clipboard
fun add(left: Quaternion, right: Quaternion, result: Quaternion): Quaternion

Computes the componentwise sum of two quaternions.

Link copied to clipboard
fun clone(quaternion: Quaternion, result: Quaternion? = definedExternally): Quaternion

Duplicates a Quaternion instance.

Link copied to clipboard
fun computeAngle(quaternion: Quaternion): Double

Computes the angle of rotation of the provided quaternion.

Link copied to clipboard
fun computeAxis(quaternion: Quaternion, result: Cartesian3): Cartesian3

Computes the axis of rotation of the provided quaternion.

Link copied to clipboard

Computes an inner quadrangle point. This will compute quaternions that ensure a squad curve is C1.

Link copied to clipboard
fun conjugate(quaternion: Quaternion, result: Quaternion): Quaternion

Computes the conjugate of the provided quaternion.

Link copied to clipboard
fun convertPackedArrayForInterpolation(packedArray: ReadonlyArray<Double>, startingIndex: Int? = definedExternally, lastIndex: Int? = definedExternally, result: ReadonlyArray<Double>? = definedExternally)

Converts a packed array into a form suitable for interpolation.

Link copied to clipboard
fun divideByScalar(quaternion: Quaternion, scalar: Double, result: Quaternion): Quaternion

Divides the provided quaternion componentwise by the provided scalar.

Link copied to clipboard
fun dot(left: Quaternion, right: Quaternion): Double

Computes the dot (scalar) product of two quaternions.

Link copied to clipboard
fun equals(left: Quaternion? = definedExternally, right: Quaternion? = definedExternally): Boolean

Compares the provided quaternions componentwise and returns true if they are equal, false otherwise.

Link copied to clipboard
fun equalsEpsilon(left: Quaternion? = definedExternally, right: Quaternion? = definedExternally, epsilon: Double? = definedExternally): Boolean

Compares the provided quaternions componentwise and returns true if they are within the provided epsilon, false otherwise.

Link copied to clipboard
fun exp(cartesian: Cartesian3, result: Quaternion): Quaternion

The exponential quaternion function.

Link copied to clipboard
fun fastSlerp(start: Quaternion, end: Quaternion, t: Double, result: Quaternion): Quaternion

Computes the spherical linear interpolation or extrapolation at t using the provided quaternions. This implementation is faster than Quaternion.slerp, but is only accurate up to 10-6.

Link copied to clipboard

Computes the spherical quadrangle interpolation between quaternions. An implementation that is faster than Quaternion.squad, but less accurate.

Link copied to clipboard
fun fromAxisAngle(axis: Cartesian3, angle: Double, result: Quaternion? = definedExternally): Quaternion

Computes a quaternion representing a rotation around an axis.

Link copied to clipboard
fun fromHeadingPitchRoll(headingPitchRoll: HeadingPitchRoll, result: Quaternion? = definedExternally): Quaternion

Computes a rotation from the given heading, pitch and roll angles. Heading is the rotation about the negative z axis. Pitch is the rotation about the negative y axis. Roll is the rotation about the positive x axis.

Link copied to clipboard
fun fromRotationMatrix(matrix: Matrix3, result: Quaternion? = definedExternally): Quaternion

Computes a Quaternion from the provided Matrix3 instance.

Link copied to clipboard
fun inverse(quaternion: Quaternion, result: Quaternion): Quaternion

Computes the inverse of the provided quaternion.

Link copied to clipboard
fun lerp(start: Quaternion, end: Quaternion, t: Double, result: Quaternion): Quaternion

Computes the linear interpolation or extrapolation at t using the provided quaternions.

Link copied to clipboard
fun log(quaternion: Quaternion, result: Cartesian3): Cartesian3

The logarithmic quaternion function.

Link copied to clipboard
fun magnitude(quaternion: Quaternion): Double

Computes magnitude for the provided quaternion.

Link copied to clipboard

Computes magnitude squared for the provided quaternion.

Link copied to clipboard
fun multiply(left: Quaternion, right: Quaternion, result: Quaternion): Quaternion

Computes the product of two quaternions.

Link copied to clipboard
fun multiplyByScalar(quaternion: Quaternion, scalar: Double, result: Quaternion): Quaternion

Multiplies the provided quaternion componentwise by the provided scalar.

Link copied to clipboard
fun negate(quaternion: Quaternion, result: Quaternion): Quaternion

Negates the provided quaternion.

Link copied to clipboard
fun normalize(quaternion: Quaternion, result: Quaternion): Quaternion

Computes the normalized form of the provided quaternion.

Link copied to clipboard
open override fun pack(value: Quaternion, array: ReadonlyArray<Double>, startingIndex: Int?): ReadonlyArray<Double>

Stores the provided instance into the provided array.

Link copied to clipboard
fun slerp(start: Quaternion, end: Quaternion, t: Double, result: Quaternion): Quaternion

Computes the spherical linear interpolation or extrapolation at t using the provided quaternions.

Link copied to clipboard

Computes the spherical quadrangle interpolation between quaternions.

Link copied to clipboard
fun subtract(left: Quaternion, right: Quaternion, result: Quaternion): Quaternion

Computes the componentwise difference of two quaternions.

Link copied to clipboard
open override fun unpack(array: ReadonlyArray<Double>, startingIndex: Int?, result: Quaternion?): Quaternion

Retrieves an instance from a packed array.

Link copied to clipboard
fun unpackInterpolationResult(array: ReadonlyArray<Double>, sourceArray: ReadonlyArray<Double>, firstIndex: Int? = definedExternally, lastIndex: Int? = definedExternally, result: Quaternion? = definedExternally): Quaternion

Retrieves an instance from a packed array converted with convertPackedArrayForInterpolation.