Quaternion

Quaternion type

Constructors

this
this(T x, T y, T z, T w)

Constructor from scalar components

this
this(Vector!(T, 3) v, T w)

Constructor from imaginary vector and real part

this
this(Range r)

Constructor by InputRange. This quaternion's all elements are filled by given range.

Members

Functions

array
T[4] array()

Get raw array data.

axis
Vector!(T, 3) axis()
Undocumented in source. Be warned that the author may not have intended to support it.
axis
void axis(Vector!(T, 3) axis)
Undocumented in source. Be warned that the author may not have intended to support it.
baseX
Vector!(T, 3) baseX()

Get the x-axis basis vector of the transformation of this quaternion

baseY
Vector!(T, 3) baseY()

Get the y-axis basis vector of the transformation of this quaternion

baseZ
Vector!(T, 3) baseZ()

Get the z-axis basis vector of the transformation of this quaternion

opBinary
Quaternion!(CommonType!(T, S)) opBinary(Quaternion!S q)

Binary operation between quaternion for "+" or "-"

opBinary
Quaternion!(CommonType!(T, S)) opBinary(Quaternion!S q)

Binary operation between quaternion for "*"

opBinary
Quaternion!(CommonType!(T, S)) opBinary(S e)

Binary operation between scalar type for "*" or "/".

opBinaryRight
Quaternion!(CommonType!(T, S)) opBinaryRight(S e)

Binary operation between scalar type for "*".

opIndex
T opIndex(size_t i)

Indexing operation.

opIndex
T opIndex(size_t i)

Indexing operation.

opOpAssign
Quaternion opOpAssign(Quaternion!S q)

Operator assign for quaternion. This function supports "+" or "-" operation.

opOpAssign
Quaternion opOpAssign(Quaternion!(S) q)

Operator assign for quaternion. This function supports "*" operation.

opOpAssign
Quaternion opOpAssign(S e)

Operator assign for scalar type. This function supports "*" or "/" operation.

opUnary
Quaternion!T opUnary()

Unary operation for "+".

opUnary
Quaternion!T opUnary()

Unary operation for "-".

opUnary
Quaternion!T opUnary()

Unary operation for "~". This means conjugation.

toString
string toString()
Undocumented in source. Be warned that the author may not have intended to support it.

Static functions

axisAngle
Quaternion axisAngle(Vector!(T, 3) axis, Angle rad)

Returns rotation quaternion decided by its rotation axis and angle.

rotFromTo
Quaternion!T rotFromTo(Vector!(T, 3) from, Vector!(T, 3) to)

Returns rotation quaternion which converts a vector to another vector.

Variables

w
T w;

Components of quaternion.

x
T x;
y
T y;
z
T z;

Components of quaternion.

Meta