syms n1 n2 n3 o1 o2 o3 o4 a1 a2 a3 a4 n=[n1;n2;n3]; o=[o1;o2;o3]; a=[a1;a2;a3]; R=[n o a]; R=subs(R,[n2 o1 a3],[1/sqrt(2) 0 0]); transpose(R)*R %show it on the monitor S=solve('n1^2 + n3^2 + 1/2=1','(2^(1/2)*o2)/2 + n3*o3','(2^(1/2)*a2)/2 + a1*n1','o2^2 + o3^2=1','a2*o2',' a1^2 + a2^2=1'); sets=[S.n1 ones(16,1)/sqrt(2) S.n3 zeros(16,1) S.o2 S.o3 S.a1 S.a2 zeros(16,1)]; % on a loop from 1 to 16 : R=[sets(i,1:3)' sets(i,4:6)' sets(i,7:9)'] % then you may verify if the cross product equations hold!!