Home > classes > @ssm > skew.m

skew

PURPOSE ^

Computes the 3X3 skew symetric matix S based on a 3D vector V

SYNOPSIS ^

function S = skew(Vector)

DESCRIPTION ^

 Computes the 3X3 skew symetric matix S based on a 3D vector V 
 such that S(V) represent the cross product operator: S(V)W=V*W
 Only the 3 coefficients of V count, it doesn't matter whether it is a row
 or column vector.

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 function S = skew(Vector)
0002 % Computes the 3X3 skew symetric matix S based on a 3D vector V
0003 % such that S(V) represent the cross product operator: S(V)W=V*W
0004 % Only the 3 coefficients of V count, it doesn't matter whether it is a row
0005 % or column vector.
0006 
0007 sizeV = size(Vector);
0008 if (sum(sizeV)==4 && ( ( sizeV(1)==1 && sizeV(2)==3 ) || ( sizeV(2)==1 && sizeV(1)==3 ) ) )
0009     S = [   0           -Vector(3)  Vector(2)   ;...
0010             Vector(3)   0           -Vector(1)  ;...
0011             -Vector(2)  Vector(1)   0           ];
0012 else
0013     display('the input vector for cross product is:');
0014     display(Vector);
0015     error('Vector for cross product is not a 3*1 nor a 1*3 matrix (see line above)!');
0016 end
0017 end

Generated on Wed 27-Aug-2008 13:30:29 by m2html © 2003