I am trying to calculate a normal on a plane using the cross command. When I try to test the result with dot, it seems, the resulting vectors isn't perpendicular to the two vectors I used for cross. What is my problem?
%load data
filename = 'test.xlsx';sheet = 1;%x|y|z are vectors, u|v|w is 0|0|0
x = xlsread(filename,sheet,'D1:D10');y = xlsread(filename,sheet,'E1:E10');z = xlsread(filename,sheet,'F1:F10');u = xlsread(filename,sheet,'A1:A10');v = xlsread(filename,sheet,'B1:B10');w = xlsread(filename,sheet,'C1:C10');%get three points from the plane: P1=(0|0|0), P2 and P3
x1fornormal= 0;y1fornormal= 0;z1fornormal= 0;P1fornormal= [x1fornormal y1fornormal z1fornormal];x2fornormal= x(1,1);y2fornormal= y(1,1);z2fornormal= z(1,1);P2fornormal= [x2fornormal y2fornormal z2fornormal]x3fornormal= x(2,1);y3fornormal= y(2,1);z3fornormal= z(2,1);P3fornormal= [x3fornormal y3fornormal z3fornormal]%construction of the normal to the plane
Normal= cross(P2fornormal,P3fornormal)dot(Normal,P2fornormal)==0 & dot(Normal,P3fornormal)==0
Best Answer