OEGeom3DUnitQuaternionRotate

template<class T, class U>
void OEGeom3DUnitQuaternionRotate(T *xyz, const U *quat, unsigned int ncoord)
template<class T, class U>
void OEGeom3DUnitQuaternionRotate(T *xyz, const U *quat, unsigned int *idx,
                                  unsigned int ncoord)

Rotates the coordinates of xyz using the unit-quaternion given by quat. The second form only rotates the coordinates according to the indices given by idx. When it is known that the input quaternion is a unit quaternion, this is more efficient than using OEGeom3DQuaternionRotate.

xyz

Array of coordinates to rotate

quat

unit-quaternion for rotation

ncoord

Number of coordinate sets to rotate

idx

Indices of the coordinates to rotate

Warning

Calling this functions when the input quaternion is not a unit quaternion could led to unexpected results.