
// -5 to 5
function limitLine(L)
	plot([-L,L],[0,0],'r:');
endfunction

function plotVertical(x,h)
	plot([x,x],[0,h],'ko-');
endfunction

function plotCircleX(x,r)
	t = 0:%pi/100:%pi
	plot(x+r*cos(t),r*sin(t),'k-');
	plot([x-r,x+r],[0,0],'ko');
endfunction

clf
limitLine(5)
plotVertical(0,5);
plotCircleX(2.0,2.0);
plotCircleX(1.5,1.5);
plotCircleX(1.5,1.0);

plotCircleX(-2.5,2);
plotCircleX(-2.5,1.5);
plotCircleX(-2.5,1);
plotCircleX(-2.5,0.5);

clf
limitLine(5)
plotCircleX(-2,2);
plotCircleX(2,2);
plotCircleX(0,4);

//title("$\pi \mbox{ The Largest Triangle Area}$");



a = gca();
a.isoview="on";
a.box="off";
a.axes_visible=["off","off","off"];
//a.data_bounds=[-1.1, -1.1; 1.1, 1.1];
xs2pdf(0,"pi.pdf");

clf
t=0:%pi/100:%pi;
xv=[4, 4*cos(t), -4, 4];
yv=[9.5, 4*sin(t), 9.5, 9.5]
xfpoly(xv,yv,-3);
limitLine(5)
plotCircleX(0,4);
plotVertical(-4,9.5)
plotVertical(4,9.5)

xstring(-4,0,"$-1$");
e=gce();
e.font_size=4;
xstring(4,0,"$1$");
e=gce();
e.font_size=4;
xstring(0-1.7,4,"$y = \sqrt{1-x^2}$");
e=gce();
e.font_size=4;

xstring(-3.5,7.5,"$\int_{-1}^{1}\int_{\sqrt{1-x^2}}^{\infty} \,\frac{dydx}{y^2} =$");
e=gce();
e.font_size=4;
xstring(-3.5,5.5,"$\int_{-1}^{1}\frac{1}{\sqrt{1-x^2}}\, dx = \pi $");
e=gce();
e.font_size=4;

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

xs2pdf(0,"pi2.pdf");
