Difference between revisions of "Qter2dcm.m"

From Spinach Documentation Wiki
Jump to: navigation, search
(sync with Spinach main f053e432: new page for quaternion to direction cosine matrix conversion)
 
(version fragment to 2.13 per IK 2026-08-30)
 
Line 26: Line 26:
 
[[dcm2qter.m]], [[qter2euler.m]], [[euler2qter.m]], [[euler2dcm.m]], [[anax2quat.m]], [[quat2anax.m]], [[Rotation conventions]]
 
[[dcm2qter.m]], [[qter2euler.m]], [[euler2qter.m]], [[euler2dcm.m]], [[anax2quat.m]], [[quat2anax.m]], [[Rotation conventions]]
  
−
''Version 2.11, authors: [[Ilya Kuprov]]''
+
''Version 2.13, authors: [[Ilya Kuprov]]''

Latest revision as of 09:12, 30 August 2026

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