Quaternion:
Filter:
Classes (extension) | Math | Libraries > MathLib > Cartesian &c.

Quaternion : Object
ExtensionExtension

quaternion number

Description

A class representing quaternion numbers.

Part of MathLib, a diverse library of mathematical functions.

Class Methods

Quaternion.new(a, b, c, d)

Create a new quaternion with the given scalar and vector parts.

Arguments:

a

scalar part

b

vector part b

c

vector part c

d

vector part d

Returns:

a new instance of Quaternion.

Quaternion.rand(min, max)

Create a new quaternion with scalar and vector parts randomly choosen between min and max.

Arguments:

min

minimum value

max

maximum value

Returns:

a new instance of Quaternion.

Inherited class methods

Instance Methods

.a

Return the scalar part.

.b

Return the vector part b.

.c

Return the vector part c.

.d

Return the vector part d.

.coordinates

Return the scalar and vector parts.

.conjugate

Return the conjugate of q is the quaternion

.norm

Return the square root of the product of a quaternion with its conjugate.

.distance(other)

Return the distance between two quaternions.

Inherited instance methods

Undocumented instance methods

*(other)

+(other)

-(other)

/(other)

==(other)

.asQuaternion

.hash

.performBinaryOpOnQuaternion(aSelector, aNumber, adverb)

.performBinaryOpOnSimpleNumber(aSelector, aNumber, adverb)

.reciprocal

.rotate

.tilt

.tumble

Examples