Vector cross product
C = cross(A,B)
C = cross(A,B,dim)
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. If A and B are multidimensional arrays, cross returns the cross product of A and B along the first dimension of length 3.
The cross and dot products of two vectors are calculated as shown:
a = [1 2 3]; b = [4 5 6]; c = cross(a,b) c = -3 6 -3 d = dot(a,b) d = 32