%% Cross Product of Complex Vectors
% Create two complex three-element vectors and find their cross product.

x = rand(3,1) + 1i*rand(3,1); 
y = rand(3,1) + 1i*rand(3,1); 
z = cross(x,y)

%
% Use dot products to verify that x\cdot z=0 and y\cdot z=0, within machine precision. In order to preserve the dot product, cross calculates a complex-conjugate cross product for complex vectors: {\left(x\times y\right)}^*.

norm(dot(x,z))
norm(dot(y,z))

% Copyright 2019 The MathWorks, Inc.