function h=MDfigures(n)
% mDfigures <Figures n for MDIntro.m>
% Usage:: h=MDfigures(n)
%

% revision history:
% 04/22/20 Mark D. Shattuck <mds> mDfigures.m

%% Main
switch n
  case 1
     clf;
    x=[0 .8]+.55;
    y=[0 .2]+.55;
    D=1;
    dx=diff(x);
    dy=diff(y);
    dnm=sqrt(dx.^2+dy.^2);
    d=D-dnm;
    plot(x,y,'k.','markersize',30);
    hold on;
    hp=plot(x(1)+dx/dnm*(D/2+[0 -d]),y(1)+dy/dnm*(D/2+[0 -d]),'k-');
    set(hp,'linewidth',10);
    quiver([0 0],[0 0],(x(2)+D/2)*[0 1],...
      (y(2)+D/2)*[1 0],0,'k','linewidth',2);
    quiver([0 0],[0 0],x,y,0,'k--','linewidth',2);
    quiver(x(1),y(1),dx,dy,0,'r','linewidth',3);
    hq=quiver(x,y,dx*[-1 1]/2,dy*[-1 1]/2,0,'r','linewidth',3);
    set(hq,'color',[0 .5 0],'MaxHeadSize', .5,'autoscalefactor',10)
    a=.4;
    quiver(x(2)*[1 1],y(2)*[1 1],...
      D/2*[sin(a) -sin(a)],D/2*[-cos(a) cos(a)],0,'b','linewidth',2);
    hc=plotNCirc(x,y,[D D],'none');
    set(hc,'linewidth',2);
    ht(8)=text(x(2)+.05*dx,y(2)+.7*dy,'$$-\vec{F}_{nm}$$');
    set(ht(8),'color',[0 .5 0]);
    ht(7)=text(x(1)-.4*dx,y(1),'$$\vec{F}_{nm}$$');
    set(ht(7),'color',[0 .5 0]);
    ht(6)=text(x(2),.05,'$$\delta=D-|\vec{d}_{nm}|$$');
    set(ht(6),'horizontal','center');
    ht(5)=text(dx/12+x(1),dy/2.3+y(1),'$$\vec{d}_{nm}$$');
    set(ht(5),'color','r');
    ht(4)=text(x(1)*(1/2-.26),y(1)*(1/2),'$$\vec{x}_n$$');
    ht(3)=text(x(2)/2,y(2)/3,'$$\vec{x}_m$$');
    ht(2)=text(mean(x)-.05*dx,mean(y)+.15*dy,'$$\delta$$');
    ht(1)=text(x(2)+dx/8,y(2)-1*dy,'$$D$$');
    set(ht(1),'color','b');
    set(ht,'interp','latex','fontsize',30,'vertical','bot');
    hold off;
    axis([-.05 x(2)+D/1.9 -.05 y(2)+D/1.9]);
    axis('off');
    h=hq;
end

