
function A = crossmat(v)

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Computes the skew-symmetric matrix A = [vx].
% This matrix is useful for computing the cross
% product:  [vx]*w = vxw for any w (3-vec, column). 
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

% Initialize variables

A = zeros(3,3) ;

% Compute skew matrix A=[vx]

A(3,2) =  v(1) ;
A(2,3) = -v(1) ;
A(1,3) =  v(2) ;
A(3,1) = -v(2) ;
A(2,1) =  v(3) ;
A(1,2) = -v(3) ;

