clc, clear all, close all

p1 = input('Input 1st point [x1 y1]= ');
while(numel(p1)~=2)
  p1 = input('Input 1st point in this format [x1 y1]= ');
end
 
p2 = input('Input 2nd point [x2 y2]= ');
while(numel(p1)~=2)
  p2 = input('Input 2nd point in this format [x2 y2]= ');
end

p1=[1 2];
p2=[3 -2];

d = sqrt((p1(1)-p2(1))^2+(p1(2)-p2(2))^2)
D = sqrt(sum((p1-p2).^2))

plot(p1(1),p1(2),'.','markersize',20)
text(p1(1)+.5,p1(2),['(',num2str(p1(1)),',',num2str(p1(2)),')'])
hold on
plot(p2(1),p2(2),'.','markersize',20)
text(p2(1)+.5,p2(2),['(',num2str(p2(1)),',',num2str(p2(2)),')'])
axis([-10 10 -10 10])
line([0 0],[-8 8])
line([-8 8],[0 0])
text(0,8.5,'y')
text(8.5,0,'x')


