
clear greatcircle
function greatcircle(e1,e2,style)
	theta = atan(e2(3),e1(3));
	t = (theta-%pi/2):0.01:(theta+%pi/2);
	plot(e1(1)*cos(t)+e2(1)*sin(t),e1(2)*cos(t)+e2(2)*sin(t),'r-');
	if ( style > 0) then
		t = (theta+%pi/2):0.01:(theta+3*%pi/2);
		plot(e1(1)*cos(t)+e2(1)*sin(t),e1(2)*cos(t)+e2(2)*sin(t),'r:');
	end
endfunction


clf

t=0:0.01:2*%pi;
plot(cos(t),sin(t),'k-');

//(1,1,1)/sqrt(3) (2,-1,-1)/sqrt(6)
greatcircle([-2,2,-1]/sqrt(9),[1,2,2]/sqrt(9),0);
greatcircle([1,1,-2]/sqrt(6),[0,2,1]/sqrt(5),0);
greatcircle([1,1,-2]/sqrt(6),[2,0,1]/sqrt(5),0);

xset("font size",5);
xstring(-0.4,-0.4,'$\alpha$');
//xstring(-0.7,-0.7,'$A_1$');
//xstring(0.5,0.5,'$A_2$');
xstring(-0.08,0.65,'$\beta$');
//xstring(-0.1,0.9,'$B_1$');
//xstring(0.1,-0.7,'$B_2$');
xstring(0.55,-0.14,'$\gamma$');
xstring(0.1,0.1,'$T$');
//xstring(0.72,-0.3,'$C_1$');
//xstring(-0.7,0.2,'$C_2$');

a=gca(); a.data_bounds=[-1.1,1.1,-1.1,1.1];
a.box="off"; a.isoview="on"; a.axes_visible=["off","off","off"];

xs2pdf(0,'triangle.pdf');
sleep(1000)

clf

t=0:0.01:2*%pi;
plot(cos(t),sin(t),'k-');
greatcircle([1,0,1]/sqrt(2),[1,0,-1]/sqrt(2),0);
greatcircle([1,0,1]/sqrt(2),[0,1,0],0);
greatcircle([1,0,-1]/sqrt(2),[0,1,0],0);
//greatcircle([1,-1,0]/sqrt(2),[0,0,1],0);

xset("font size",5);
xstring(0,1,'P');
xstring(-1/sqrt(2),0,'A');
xstring(1/sqrt(2),0,'B');

xstring(-1,0,'C');
xstring(1,0,'D');
xstring(0,-1,'E');

a=gca(); a.data_bounds=[-1.1,1.1,-1.1,1.1];
a.box="off"; a.isoview="on"; a.axes_visible=["off","off","off"];

xs2pdf(0,'biggest.pdf');
sleep(1000)

