function sinangle = sin_angle(vec1,vec2)
%
% function sinangle
%
% Compute the sine of the angle between two vector arrays
%
% Remi Tailleux, University of Reading, 20 October 2016
%---------------------------------------------------------
cp = cross(vec1,vec2);
norm_cp = sqrt(cp(:,:,:,1).^2 + cp(:,:,:,2).^2 + cp(:,:,:,3).^2);
norm_v1 = sqrt(vec1(:,:,:,1).^2 + vec1(:,:,:,2).^2 + vec1(:,:,:,3).^2);
norm_v2 = sqrt(vec2(:,:,:,1).^2 + vec2(:,:,:,2).^2 + vec2(:,:,:,3).^2);

sinangle = norm_cp./(norm_v1.*norm_v2);
end

