% illustrates cross (vector) product % and the volume of parallelepiped P = [0, 1, 2]; Q = [2,4,5]; R =[-1,0,1]; S = [6,-1,4]; a = Q - P; % vectors a,b,c b = R - P; c = S - P; arrow3([0,0,0], [1,0,0],'yellow'); arrow3([0,0,0], [0,1,0],'yellow'); arrow3([0,0,0], [0,0,1],'magenta'); % this plots the i,j,k, vectors arrow3(P, Q,'red'); arrow3(P, R,'green'); arrow3(P, S,'blue'); % this plots the vectors axb = cross(a,b); % cross-product arrow3(P, P + axb, 'black'); plot3([-2,-2,7], [-2,7,-2], [7,-2,-2],'*w') % this sets the window of specified size Qp = S + a; lineOM(S,Qp); % this adds remaining lines to the ppiped lineOM(Q,Qp); T = Q + b; lineOM(Q, T); lineOM(R, T); Rp = R + c; lineOM(R, Rp); lineOM(S,Rp); Tp = T+c; lineOM(T,Tp); lineOM(Qp, Tp); lineOM(Rp, Tp);