function [A] = Skew3(a)

% This function takes as input either a vector in R^3 or a 3x3 skew symmetric matrix. The user is responsible for managing the input (no error check on this.)

% The function associates a vector with a skew-symmetric matrix 
% so that Skew3(Skew3(a))=a (or a' if a is a row vector.)

    if isvector(a)
        A = [0, -a(3), a(2); a(3), 0, -a(1); -a(2), a(1), 0];
    
    else
        A = [-a(2,3); a(1,3); -a(1,2)];
    end
    
end