Fast calculation of cross product c = vb_cross2(a,b) c = a x b a, b , c : N x 3 Copyright (C) 2011, ATR All Rights Reserved. License : New BSD License(see VBMEG_LICENSE.txt)
0001 function c = vb_cross2(a,b) 0002 % Fast calculation of cross product 0003 % c = vb_cross2(a,b) 0004 % c = a x b 0005 % a, b , c : N x 3 0006 % 0007 % Copyright (C) 2011, ATR All Rights Reserved. 0008 % License : New BSD License(see VBMEG_LICENSE.txt) 0009 0010 c = [a(:,2).*b(:,3)-a(:,3).*b(:,2), ... 0011 a(:,3).*b(:,1)-a(:,1).*b(:,3), ... 0012 a(:,1).*b(:,2)-a(:,2).*b(:,1)];