- 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)
- __getitem__(i: int) double
Element access: q[0] is the real part, (q[1],q[2],q[3]) is the imaginary part.
- angle() double
Return the angle of the axis/angle representation in radians
- invert()
Invert in place: this = 1 / this
- length() double
Return the R4 length
- normalize()
Normalize in place
- 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