class Quatd

A 64 bits float quaternion.

w:double
x:double
y:double
z:double
Quatd()

Default constructor is the identity quat

Quatd(s: double, i: double, j: double, k: double)

Initialize with real part s and imaginary vector (i,j,k)

Quatd(s: double, d: V3d)

Initialize with real part s and imaginary vector d

__eq__(o: Quatd) bool

Equality

__neq__(o: Quatd) bool

Inequality

__getitem__(i: int) double

Element access: q[0] is the real part, (q[1],q[2],q[3]) is the imaginary part.

__xor__(o: Quatd) double

4D dot product

__mul__(o: Quatd) Quatd

Quaternion multiplication

__mul__(t: double) Quatd

Quaternion*scalar multiplication

__truediv__(o: Quatd) Quatd

Quaternion division

__truediv__(t: double) Quatd

Quaternion division

__add__(q2: Quatd) Quatd

Quaternion addition

__sub__(q2: Quatd) Quatd

Quaternion subtraction

angle() double

Return the angle of the axis/angle representation in radians

axis() V3d

Return the axis of the axis/angle representation

euclideanInnerProduct(q: Quatd) double

Return the Euclidean inner product

exp() Quatd

Return the exponent of the quaternion

inverse() Quatd

Return 1/this, leaving this unchanged.

invert()

Invert in place: this = 1 / this

log() Quatd

Return the logarithm of the quaternion

length() double

Return the R4 length

normalize()

Normalize in place

normalized() Quatd

Return a normalized quaternion, leaving this unmodified.

rotateVector(v: V3d) V3d

Rotate the given point by the quaternion.

setRotation(fromDirection: Vec3, toDirection: Vec3)

Set the quaternion to be a rotation that transforms the direction vector fromDirection to toDirection.

setAxisAngle(axis: Vec3, angle: Vec3)

Set the quaternion to be a rotation around the given axis by the given angle in radians.

toMatrix33()

Return a 3x3 rotation matrix

toMatrix44()

Return a 4x4 rotation matrix