CROSS3 3D cross parallel cross product D = DOT3(A,B) calculates the dot product between rows of matrices A and B, both of which must be Nx3. D is Nx1 such that C(i) = dot(A(i,:),B(i,:)) but it is calculated faster.
0001 function d = dot3(a,b) 0002 %CROSS3 3D cross parallel cross product 0003 % D = DOT3(A,B) calculates the dot product between rows of matrices A 0004 % and B, both of which must be Nx3. D is Nx1 such that 0005 % C(i) = dot(A(i,:),B(i,:)) 0006 % but it is calculated faster. 0007 0008 % (C) 2013 Bartlomiej Grychtol. License: GPL version 2 or 3. 0009 % $Id: dot3.m 4260 2013-06-24 15:17:15Z aadler $ 0010 0011 d = sum(a.*b,2);