classdef E1 < E0
    % An E1 object represents the ellipse 
    %                (h+a*cos(t),kb*sin(t))        0<=t<=2pi  
    % Such an ellipse is centered at (h,k) and has no tilt.
    % Terminology:
    %    E1 is a subclass of E0. E0 is the parent of E1
    %    E0 is a superclass of E0. E1 is a child of E0.
   
    properties (Access = protected)
        h  % the x-coordinate of the center
        k  % the y-coordinate of the center

    end
    
    methods
        function E = E1(a,b,h,k)
        % Constructs an E1 object
        % Call the superclass constructor...
           E@E0(a,b)              
           E.h = h;
           E.k = k;
           E.F1.x = E.F1.x + h;
           E.F1.y = k;
           E.F2.x = E.F2.x + h;
           E.F2.y = k;
        end
       
        % Displays the ellipse referenced by ThisE1 in the current figure window
        % with color c. The focii are also displayed. Assumes hold is on.
        function Show(ThisE1,c)
        
           x = ThisE1.a*cos(linspace(0,2*pi));
           y = ThisE1.b*sin(linspace(0,2*pi));
           F1 = ThisE1.F1;
           F2 = ThisE1.F2;
           h = ThisE1.h;
           k = ThisE1.k;
           plot(h+x,k+y,c)
           plot(F1.x,F1.y,'.k','Markersize',20)
           plot(F2.x,F2.y,'.k','Markersize',20)
        end
                
    end
    
end

