u:=1cm;
r:=2pt;

filenametemplate "homework-3-one-point.mps";
beginfig(1);
n:=1;
theta1:=40;
for i=1 upto n:  x[i]=u*cosd(theta[i]);  y[i]=u*sind(theta[i]);  endfor
draw (u,0)  for t=20 step 20 until 340:  ..(u*cosd(t),u*sind(t))  endfor  ..cycle;
for i=1 upto (n-1):  for j=(i+1) upto n:  draw z[i]--z[j];  endfor  endfor
pickup pencircle scaled 2r;
for i=1 upto n:  draw z[i];  endfor
endfig;

filenametemplate "homework-3-two-points.mps";
beginfig(1);
n:=2;
theta1:=130;
theta2:=-10;
for i=1 upto n:  x[i]=u*cosd(theta[i]);  y[i]=u*sind(theta[i]);  endfor
draw (u,0)  for t=20 step 20 until 340:  ..(u*cosd(t),u*sind(t))  endfor  ..cycle;
for i=1 upto (n-1):  for j=(i+1) upto n:  draw z[i]--z[j];  endfor  endfor
pickup pencircle scaled 2r;
for i=1 upto n:  draw z[i];  endfor
endfig;

filenametemplate "homework-3-three-points.mps";
beginfig(1);
n:=3;
theta1:=70;
theta2:=-160;
theta3:=-35;
for i=1 upto n:  x[i]=u*cosd(theta[i]);  y[i]=u*sind(theta[i]);  endfor
draw (u,0)  for t=20 step 20 until 340:  ..(u*cosd(t),u*sind(t))  endfor  ..cycle;
for i=1 upto (n-1):  for j=(i+1) upto n:  draw z[i]--z[j];  endfor  endfor
pickup pencircle scaled 2r;
for i=1 upto n:  draw z[i];  endfor
endfig;

filenametemplate "homework-3-four-points.mps";
beginfig(1);
n:=4;
theta1:=80;
theta2:=150;
theta3:=-110;
theta4:=-20;
for i=1 upto n:  x[i]=u*cosd(theta[i]);  y[i]=u*sind(theta[i]);  endfor
draw (u,0)  for t=20 step 20 until 340:  ..(u*cosd(t),u*sind(t))  endfor  ..cycle;
for i=1 upto (n-1):  for j=(i+1) upto n:  draw z[i]--z[j];  endfor  endfor
pickup pencircle scaled 2r;
for i=1 upto n:  draw z[i];  endfor
endfig;

filenametemplate "homework-3-five-points.mps";
beginfig(1);
n:=5;
theta1:=20;
theta2:=90;
theta3:=150;
theta4:=-130;
theta5:=-60;
for i=1 upto n:  x[i]=u*cosd(theta[i]);  y[i]=u*sind(theta[i]);  endfor
draw (u,0)  for t=20 step 20 until 340:  ..(u*cosd(t),u*sind(t))  endfor  ..cycle;
for i=1 upto (n-1):  for j=(i+1) upto n:  draw z[i]--z[j];  endfor  endfor
pickup pencircle scaled 2r;
for i=1 upto n:  draw z[i];  endfor
endfig;

end;