<< poledetection SIP - Scilab Image Processing Toolbox quaternion_matrix >>

SIP - Scilab Image Processing Toolbox >> SIP - Scilab Image Processing Toolbox > quaternion2rot_matrix

quaternion2rot_matrix

Converts a quaternion to a rotation matrix

Calling Sequence

R = quaternion2rot_matrix(q)

Parameters

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

Description

quaternion2rot_matrix converts a quaternion representation of a rotation to the usual 3x3 matrix 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


<< poledetection SIP - Scilab Image Processing Toolbox quaternion_matrix >>