qter2dcm.m
Converts a unit quaternion into a direction cosine matrix in the active convention, matching the one used by euler2dcm.m function. The quaternion is divided by its Euclidean norm before the matrix is assembled from the standard bilinear combinations of the components, so that inputs that are only approximately normalised are accepted.
Syntax
dcm=qter2dcm(q)
Parameters
q - structure with four scalar fields q.u, q.i, q.j,
q.k giving the four components of the quaternion
Outputs
dcm - directional cosine matrix
Notes
The resulting rotation matrix is to be used as follows:
v=R*v (for 3x1 vectors)
A=R*A*R' (for 3x3 interaction tensors)
Matlab's Aerospace Toolbox quat2dcm() returns the transpose of this matrix for the same quaternion.
See also
dcm2qter.m, qter2euler.m, euler2qter.m, euler2dcm.m, anax2quat.m, quat2anax.m, Rotation conventions
Version 2.13, authors: Ilya Kuprov