Quaternion Class

From Derivative
Jump to: navigation, search

Quaternion



Members

tdu.Quaternion.wfloat (Read Only):

Quaternion_w

tdu.Quaternion.xfloat (Read Only):

Quaternion_x

tdu.Quaternion.yfloat (Read Only):

Quaternion_y

tdu.Quaternion.zfloat (Read Only):

Quaternion_z

Methods

tdu.Quaternion.lerp(q2, lerpF)quaternion:

Returns a quaternion as the linear interpolation of the current quaternion (q) and another quaternion (q2) using an interpolation factor (lerpF) in the range [0,1].
l = q.lerp(q2, lerpF)

tdu.Quaternion.length()float:

Returns the length of the current quaternion.
l = q.length()

tdu.Quaternion.cross(q2)vector:

Returns the cross product of the current quaternion and another quaternion.
l = q.cross(q2)

tdu.Quaternion.rotate(vec)vector:

Rotates a vector using the current quaternion and returns a new vector.
l= q.rotate(vec)

tdu.Quaternion.slerp(q2, slerpF)quaternion:

Returns a quaternion as the spherical interpolation of the current quaternion (q) and another quaternion (q2) using an interpolation factor (slerpF).
l = q.slerp(q2, slerpF)

tdu.Quaternion.eulerAngles(order='xyz')tuple:

Returns euler angles in degrees as a tuple (i.e. pitch as x, yaw as y, roll as z) from current quaternion. The 'order' argument can be set to any valid rotation order which by default is set to 'xyz'.
l = q.eulerAngles(order='xyz')

tdu.Quaternion.axis()vector:

Returns the rotation axis vector of the current.
l = q.axis()

tdu.Quaternion.dot(q2)float:

Returns the dot product (float) of the current quaternion and another quaternion.
l = q.dot(q2)

tdu.Quaternion.exp()quaternion:

Returns the exponential of the current as a new quaternion.
l = q.exp()

tdu.Quaternion.copy()quaternion:

Quaternion copy

tdu.Quaternion.log()quaternion:

Returns the natural logarithm of the current as a new quaternion.
l = q.log()

tdu.Quaternion.inverse()None:

Invert the current quaternion.
q.inverse()

tdu.Quaternion.angle()float:

Returns the rotation angle (in degrees) of the current.
l = q.angle()