% example_211
% dipole potential and electric field
clear;clf
[x,y]=meshgrid(-1: .1: 1, -1: .1: 1);
R1=(x.^2+(y-0.25).^2).^.5;
R2=(x.^2+(y+0.25).^2).^.5;
V=(1./R1) - (1./R2);
subplot (2, 1, 1)
    R1=(x.^2+(y-0.25).^2).^.5;
    R2=(x.^2+(y+0.25).^2).^.5;
    V=(1./R1) - (1./R2);
    surf(x,y,V)
    axis off
    view(- 37.5,20)
    text(-3, -2, 35,'(a)','fontsize', 18)
subplot (2, 1, 2)
    contour(x/5,y/5,V, 5)
    hold on
    axis square 
    [u,v] =gradient (V, .2);
    quiver(x,y,-u,-v)
    axis equal
    axis off
    hold off
    text(-1/2, 1/4, '(b)','fontsize', 18)
