
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)
//(1/2,1/2,1/sqrt(2) (1,1,sqrt(2))/2
greatcircle([-1/2,-1/2,1/sqrt(2)],[1/2,1/2,1/sqrt(2)],0);

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

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

xset("font size",5);
xstring(-0.2,0.1,'$T_1$')
xstring(0.05,-0.2,'$T_2$')
xstring(-0.33,0.18,'$\beta$')
xstring(0.2,-0.3,'$\delta$')
xstring(-0.5,-0.32,'$\alpha_1$')
xstring(-0.4,-0.48,'$\alpha_2$')
xstring(0.2,0.3,'$\gamma_1$')
xstring(0.3,0.24,'$\gamma_2$')

title('$\mbox{Area } = T_1+T_2 = \alpha+\beta+\gamma+\delta - (n-2)\pi$', 'fontsize',5)

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


xs2pdf(0,'quad.pdf');
