Professional Documents
Culture Documents
BTN Refleksi
BTN Refleksi
minx=min([xA txA]);
miny=min([yA tyA]);
maxx=max([xA txA]);
maxy=max([yA tyA]);
% Menyesuaikan sumbu-x
if minx>-b && maxx<b
minxx=-b; maxxx=b;
else
if maxx>=b
maxxx=maxx+2;
z=maxx+2-2*b;
z=min([z minx]);
if z <= 0
minxx=z-2;
else
minxx=-1;
end;
else
if minx<=-b
minxx=minx-2;
z=minx-2+2*b;
z=max([z maxx]);
if z >=0
maxxx=z+2;
else
maxxx=1;
end;
end;
end;
end;
% Menyesuaikan sumbu-y
if miny>-b && maxy<b
minyy=-b; maxyy=b;
else
if maxy>=b
maxyy=maxy+2;
z=maxy+2-2*b;
z=min([z miny]);
if z <= 0
minyy=z-2;
else
minyy=-1;
end;
else
if miny<=-b
minyy=miny-2;
z=miny-2+2*b;
z=max([z maxy]);
if z >=0
maxyy=z+2;
else
maxyy=1;
end;
end;
end;
end;
set(handles.ExA1,'Visible','on');
set(handles.EyA1,'Visible','on');
set(handles.ExA1, 'String', num2str(txA));
set(handles.EyA1, 'String', num2str(tyA));
plot(xA,yA,'r*',txA,tyA,'b*',xx,xy,'k',
yx,yy,'k',txg1,tyg1,'g-.',0,0,'ro');
axis([minxx maxxx minyy maxyy]);grid;%range gambar
%Memberi text titik nol
a1=abs(maxxx-minxx)/200;b1=abs(maxyy-minyy)/50;
text(a1,-b1,'0');
xA=xA+a1;yA=yA-b1;xA1=txA+a1;yA1=tyA-b1;
text(xA,yA,'A');text(xA1,yA1,'A1');
xP=a1;yP=b1;text(xP,yP,'P');
case 3
% REFLEKSI thd titik (0,0) --> untuk GARIS
xA=str2double(get(handles.ExA, 'String'));
yA=str2double(get(handles.EyA, 'String'));
xB=str2double(get(handles.ExB, 'String'));
yB=str2double(get(handles.EyB, 'String'));
% Menyesuaikan sumbu-x
if minx>-b && maxx<b
minxx=-b; maxxx=b;
else
if maxx>=b
maxxx=maxx+2;
z=maxx+2-2*b;
z=min([z minx]);
if z <= 0
minxx=z-2;
else
minxx=-1;
end;
else
if minx<=-b
minxx=minx-2;
z=minx-2+2*b;
z=max([z maxx]);
if z >=0
maxxx=z+2;
else
maxxx=1;
end;
end;
end;
end;
% Menyesuaikan sumbu-y
if miny>-b && maxy<b
minyy=-b; maxyy=b;
else
if maxy>=b
maxyy=maxy+2;
z=maxy+2-2*b;
z=min([z miny]);
if z <= 0
minyy=z-2;
else
minyy=-1;
end;
else
if miny<=-b
minyy=miny-2;
z=miny-2+2*b;
z=max([z maxy]);
if z >=0
maxyy=z+2;
else
maxyy=1;
end;
end;
end;
end;
xx=minxx:0.1:maxxx; xy=0.*xx; %xx dan xy untuk sumbu
x
yy=minyy:0.1:maxyy; yx=0.*yy; %yx dan yy untuk sumbu
y
set(handles.ExA1,'Visible','on');
set(handles.EyA1,'Visible','on');
set(handles.ExA1, 'String', num2str(txA));
set(handles.EyA1, 'String', num2str(tyA));
set(handles.ExB1,'Visible','on');
set(handles.EyB1,'Visible','on');
set(handles.ExB1, 'String', num2str(txB));
set(handles.EyB1, 'String', num2str(tyB));
plot(xA,yA,'r*',xB,yB,'r*',txA,tyA,'b*',txB,tyB,'b*',xx,xy,'k',
yx,yy,'k',xg12,yg12,'b',txg1,tyg1,'g-.',txg2,tyg2,'g-
.',txg12,tyg12,'r',0,0,'ro' );
axis([minxx maxxx minyy maxyy]);grid;%range gambar
%Memberi text titik nol
a1=abs(maxxx-minxx)/200;b1=abs(maxyy-minyy)/50;
text(a1,-b1,'0');
xA=xA+a1;yA=yA-b1;xA1=txA+a1;yA1=tyA-b1;
xB=xB+a1;yB=yB-b1;xB1=txB+a1;yB1=tyB-b1;
text(xA,yA,'A');text(xA1,yA1,'A1');
text(xB,yB,'B');text(xB1,yB1,'B1');
xP=a1;yP=b1;text(xP,yP,'P');
case 4
% REFLEKSI thd titik (0,0) --> untuk SEGITIGA
xA=str2double(get(handles.ExA, 'String'));
yA=str2double(get(handles.EyA, 'String'));
xB=str2double(get(handles.ExB, 'String'));
yB=str2double(get(handles.EyB, 'String'));
xC=str2double(get(handles.ExC, 'String'));
yC=str2double(get(handles.EyC, 'String'));
% dst
case 5
% REFLEKSI thd titik (0,0) --> untuk SEGIEMPAT
xA=str2double(get(handles.ExA, 'String'));
yA=str2double(get(handles.EyA, 'String'));
xB=str2double(get(handles.ExB, 'String'));
yB=str2double(get(handles.EyB, 'String'));
xC=str2double(get(handles.ExC, 'String'));
yC=str2double(get(handles.EyC, 'String'));
xD=str2double(get(handles.ExD, 'String'));
yD=str2double(get(handles.EyD, 'String'));
%dst
end;
case 3
% REFLEKSI thd TITIK P(a,b)
indeks1=get(handles.popupmenu1,'Value');
switch indeks1
case 2
case 3
case 4
case 5
end;
case 4
% REFLEKSI thd sumbu-x
indeks1=get(handles.popupmenu1,'Value');
switch indeks1
case 2
case 3
case 4
case 5
end;
case 5
% REFLEKSI thd sumbu-x
indeks1=get(handles.popupmenu1,'Value');
switch indeks1
case 2
case 3
case 4
case 5
end;
case 6
% REFLEKSI thd sumbu-x
indeks1=get(handles.popupmenu1,'Value');
switch indeks1
case 2
case 3
case 4
case 5
end;
case 7
case 8
case 9
case 10
case 11
end;