% Show E2
% Illustrates the class E2.

clear all
clear class
close all
plot([-10 10],[0 0],':k',[0 0],[-10 10],':k')
axis equal
axis([-10 10 -10 10])
hold on

% Construct and display an E2 object...
E = E2(4,3,5,6,30);
E.Show('m')

% Construct and display its unrotated version centered at the origin..
Eorig = E0(4,3);
Eorig.Show('r')

% Construct and display a Point object..
P = Point(-2,-2);
P.Show('b')

% Report on whether or not the ellipse referenced by E and the ellipse
% referenced by Eorig encloses the point referenced by P...
if E.Enclose(P) && Eorig.Enclose(P)
    title('P is inside E and Eorig','Fontsize',14)
elseif E.Enclose(P) && ~Eorig.Enclose(P)
    title('P is inside E but not inside Eorig','Fontsize',14)
elseif ~E.Enclose(P) && Eorig.Enclose(P)
    title('P is not inside E and is inside Eorig','Fontsize',14)
else
    title('P is not inside E and not inside Eorig','Fontsize',14)
end

% Report the area...
xlabel(sprintf('Area = %6.2f',E.Area()),'Fontsize',14)

