clear all

MaxX=100;MaxY=100;
global M
M=zeros(MaxX,MaxY);

nv=10000;
set(0,'recursionlimit',nv);
global Filler
Filler=1234;
global lineColor2
lineColor2=23;
color3=301;
lineColor=14;
global Ax
Ax=axes;
image(M');set(Ax,'YDir','normal');

[X,Y]=ginput(2);      
X=floor(X);
Y=floor(Y);

A1=(X(1));A2=(Y(1));
B1=(X(2));B2=(Y(2));

for i = A1:1:B1      
    for j = A2:1:B2 
        M(i,j)=Filler;
    end
end

image(M');set(Ax,'YDir','normal');

[X,Y]=ginput(2);     
    
X=floor(X);
Y=floor(Y);

X1=(X(1));X2=(X(2));
Y1=(Y(1));Y2=(Y(2));

DrawLine(X1,Y1,X2,Y2,lineColor);

image(M');
set(Ax,'YDir','normal');

pause(1)

CohenSutherland( X1,Y1,X2,Y2,A1, A2, B1, B2);

image(M');
set(Ax,'YDir','normal');


