% ShowPointCircle
% Manipulating Point and Circle Objects
close all
figure
plot([-5 5],[0 0],':k',[0 0],[-5 5],':k') 
axis equal square
hold on

% Create a point and display it with red..
P = Point(3,0);
P.Show('r')
% Create a new point by rotating the point referenced by P and display 
% it with green...
Q = P.Rotate(45);
Q.Show('g')
% Create a circle and display it with black and its center with magenta..
C = Circle(-1,-2,2);
C.Show('k')
C.center.Show('m')
hold off



% Compute two ways the distance from the point referenced by P to the
% circle referenced by C...
d1 = C.Dist(P);
d2 = P.Dist(C);


text(2.2,.4,'P = Point(3,0)','Fontsize',16)
text(1,2.5,'Q = P.Rotate(30)','Fontsize',16)
text(-2,-4.5,'C = Circle(-1,-2,2)','Fontsize',16)
text(-2,-1.5,'C.center','Fontsize',16)
title(sprintf('C.Dist(P) = %5.2f   P.Dist(C) = %5.2f',d1,d2),'Fontsize',16)


