cross
Cross product of two 3-element vectors.
Syntax
Section titled “Syntax”C = cross(A, B)C = cross(A, B, dim)Description
Section titled “Description”Returns the 3-element cross product A × B. A and B must each have a length-3 dimension; for matrices, cross operates along the first dimension of size 3 by default, or along dim if specified.
Examples
Section titled “Examples”cross([1 0 0], [0 1 0]) % [0 0 1] (i × j = k)A = [1 2; 3 4; 5 6]; % 3×2B = [7 8; 9 10; 11 12];cross(A, B) % 3×2 with column-wise cross productsSee also
Section titled “See also”dot— Vector or array dot product.