close all;clear all;clc; % Define Quartions with specific designations q1to4=[1 2 3 4;2 3 4 1;3 4 1 2;4 1 2 3]; % Right-handed Spin=+1 q5to8=[1 4 3 2;2 1 4 3;3 2 1 4;4 3 2 1]; % Left-handed Spin=-1 q9to12=[1 2 4 3;2 3 1 4;3 4 2 1;4 1 3 2]; % Right flip left Spin=0.5 q13to16=[1 4 2 3;2 1 3 4;3 2 4 1;4 3 1 2]; % Left flip right Spin=0.5 q17to20=[1 3 4 2;2 4 1 3;3 1 2 4;4 2 3 1]; % Flip right flip Spin=0.5 q21to24=[1 3 2 4;2 4 3 1;3 1 4 2;4 2 1 3]; % Flip left flip Spin=0.5 quartions=[q1to4;q5to8;q9to12;q13to16;q17to20;q21to24]; % Define Octions with specific designations; valid pairings of Quartions o1to4=[1 2;2 3;3 4;1 4]; % Right handed Spin=+1 o5to8=[5 6;6 7;7 8;5 8]; % Left handed Spin=-1 o9to12=[1 6;2 7;3 8;4 5]; % Static flip Static Spin=0 o13to16=[9 14;10 15;11 16;12 13]; % Static flip Static Spin=0 (same as above) o17to20=[2 5;3 6;4 7;1 8]; % Flip static flip Spin=0 o21to24=[17 22;18 23;19 24;20 21]; % Flip static flip Spin=0 (same as above) o25to28=[10 13;11 14;12 15;9 16]; % Flip flip flip Spin=0 o29to32=[18 21;19 22;20 23;17 24]; % Flip flip flip Spin=0 (same as above) o33to36=[9 10;10 11;11 12;9 12]; % Right flip left Spin=0.5 o37to40=[13 14;14 15;15 16;13 16]; % Left flip right Spin=0.5 o41to44=[17 18;18 19;19 20;17 20]; % Flip right flip Spin=0.5 o45to48=[21 22;22 23;23 24;21 24]; % Flip left flip Spin=0.5 octions=[o1to4;o5to8;o9to12;o13to16;o17to20;o21to24;o25to28;o29to32;o33to36;o37to40;o41to44;o45to48]; % Define vectors and colours of the four spatial possibilities pangles=[0,1,0,90;1,0,0,90;0,1,0,-90;1,0,0,-90]; cols=[218/255 6/255 9/255;255/255 222/255 89/255;0/255 191/255 99/255;56/255 182/255 255/255]; figure('units','normalized','outerposition',[0 0 1 1]) hold on xo=0; for on=45:48; % Example Octions 45 through 48 if mod(on,4)==1 xo=xo+2;end; qpair=[octions(on,:)]; for qn=1:2; % Both pairs of Quartions quartion=quartions(qpair(qn),:);t=0; origin=[xo,0,0]; for n=1:length(quartion)*1;nmod=mod(n-1,4)+1;p=quartion(nmod); unitArrow3d(origin,pangles(p,1:3),pangles(p,4),cols(p,:),qn); % Show unit spatial possibility unitArrow3d(origin,[1 0 0],180,[0.5 0.5 0.5],1); % Show unit time label=['O',num2str(on),' (Q',num2str(qpair(1)),' Q',num2str(qpair(2)),')']; text(origin(1),origin(2),.75,label,'Interpreter','tex','color','white','FontSize',10); t=t+1;origin(3)=origin(3)-1;end end; xo=xo+2.5; end axis equal axis auto view([30 20]) camroll(0) set(gca,'visible','off') set(gca,'xtick',[]) set(gcf, 'Color', 'k'); % Set figure background to black set(gcf, 'Renderer', 'painters'); exportgraphics(gcf,'vectorfig.pdf','ContentType','vector','BackgroundColor','black') return % Function to draw colour-coded unit possibilities; % a ball at origin with extending cylindrical shaft and cone % disc applied if pairnum is not 1 function unitArrow3d(origin,direction,rotation,colourRGB,pairnum) a=(pi/180)*(-90:10:60);z=0.05*sin(a);y=0.05*cos(a);x=a*0; if pairnum==1 z=[z 0.75 0.75 1];y=[y 0.025 0.07 0];x=[x 0 0 0]; else z=[z 0.498 0.498 0.502 0.502 0.75 0.75 1];y=[y 0.025 0.07 0.07 0.025 0.025 0.07 0];x=[x 0 0 0 0 0 0 0];end a=0:pi/16:33/16*pi;xm=sin(a)';ym=cos(a)';x=xm*y;y=ym*y;zm=xm./xm;z=zm*z; x=x+origin(1);y=y+origin(2);z=z+origin(3); unitArrow3d=surf(x,y,z,'FaceColor',colourRGB,'EdgeColor','none'); rotate(unitArrow3d,direction,rotation,origin); end