function amat = skew_sym( avec )
% form skew symmetric matrix from vector
%
% INPUT
% avec = 3x1 vector
%
% OUTPUT
% amat = 3x3 matrix
%
% REFERENCE
% Haug, Computer-Aided Kinematics and Dynamics of Mechanical Systems, Allyn-Bacon, 1989
%
% UPDATE
% 12.04.23, tested under MATLAB v5.2
%
% AUTHOR
% H.J. Sommer III, Ph.D., Professor of Mechanical Engineering, 337 Leonhard Bldg
% The Pennsylvania State University, University Park, PA  16802
% (814)863-8997  FAX (814)865-9693  hjs1@psu.edu  www.me.psu.edu/sommer/

amat = zeros(3,3);
amat(1,2) = -avec(3);
amat(1,3) =  avec(2);
amat(2,3) = -avec(1);
amat(2,1) =  avec(3);
amat(3,1) = -avec(2);
amat(3,2) =  avec(1);

% bottom of skew_sym