Quaternion(w=0.0, x=0.0, y=0.0, z=0.0, v=None)
Represents a quaternion in scalar-first form: [w, x, y, z].
w:float | Quaternion | Vector3D | array-like- If
visNoneandwis numeric,wis scalar part. - If
wisQuaternion, copies values. - If
wisVector3D, creates pure quaternion[0, x, y, z]. - If
wis length-4 array, interpreted as[w, x, y, z]. - If
wis length-3 array, interpreted as[0, x, y, z].
- If
x:float, default0.0.y:float, default0.0.z:float, default0.0.v: optional alternate input source (Quaternion,Vector3D, length-3/4 array-like).
q1 + q2,q1 - q2q1 * q2(Hamilton product)q * Vector3D(vector promoted to pure quaternion)q * scalar,scalar * qq / scalar
normalize()- In-place normalization to unit quaternion.
q.v -> Vector3D: vector part(x, y, z).q.q -> np.ndarray: array[w, x, y, z].q.conjugate -> Quaternion:[w, -x, -y, -z].q.inverse -> Quaternion:conjugate / ||q||^2.q.norm -> float: quaternion magnitude.q.r33 -> np.ndarray:3x3rotation matrix.q.isZero -> bool: near-zero check using module epsilon.
- Many hot paths are optionally accelerated by
pyIMU._qcore. - Rotation convention in this project is NED.