<< rgbplot SIP - Scilab Image Processing Toolbox sip_colormap >>

SIP - Scilab Image Processing Toolbox >> SIP - Scilab Image Processing Toolbox > rot_matrix2quaternion

rot_matrix2quaternion

Converts a rotation matrix to a quaternion representation

Calling Sequence

q = rot_matrix2quaternion(R)

Parameters

R
3x3 orthogonal matrix representing the underlying rotation
q
4 element vector representing the quaternion.

Description

rot_matrix2quaternion converts a 3x3 matrix representation of a rotation to the quaternion representation. This is important in robotics as well as in inverse kinematic problems arising in 3D computer vision.

Examples

// Generate a random unit quaternion to represent a 3D rotation.
q = rand(4,1);
q = q / norm(q);

// Convert it to a rotation matrix,
// and convert back to verify that these routines
// are self-inverse
R = quaternion2rot_matrix(q);
qback = rot_matrix2quaternion(R);

// q should equal qback
q, qback

Authors

Availability

The latest version of SIP can be found at

http://siptoolbox.sf.net

See Also


<< rgbplot SIP - Scilab Image Processing Toolbox sip_colormap >>