function [c] = cprod(a, b)
%   C = CROSS(A,B) returns the cross product of the vectors
%   A and B.  That is, C = A x B.  A and B must be 3 element
%   vectors.

% using matrix multiplication
c = [0 -a(3) a(2); a(3) 0 -a(1); -a(2) a(1) 0] * b(:);


% alternatively by multiplying elements of a and b
%
% c = [a(2)*b(3) - a(3)*b(2), a(3)*b(1) - a(1)*b(3), a(1)*b(2) - a(2)*b(1)];

end
