quatvecmult#
- torchspin.quatvecmult(q, v)[source]#
Rotate a 3-vector (or batch of vectors) by a unit quaternion.
- Parameters:
q (array_like, shape (4,) or (4, N)) – Unit quaternion(s).
v (array_like, shape (3,) or (3, N)) – Vector(s) to rotate.
- Returns:
r (ndarray, shape (3,) or (3, N)) – Rotated vector(s).
- Return type:
Notes
Computes
r = q ⊗ [0,v] ⊗ q⁻¹(pure quaternion sandwich product).