23 Mart 2010 Salı

Matlab’da fplot(),plot(),sqrt() ile Simetri Örneği



%www.ethemsulan.com
subplot(2,2,1)
hold on
x=-10:0.01:10;
y=x;
plot(3/5*x,y)
y=0*x;
plot(x,y)
y=x;
plot(0*x,y)
y=3/5*x;
plot(x,y)
y=x;
plot(-3/5*x,y)
y=3/5*x;
plot(-x,y)
subplot(2,2,2)
hold on
fplot('-x+2',[-10 16 -10 10])
ad=[-8 -6 -4 -6 -6 -8 -4 -6 -6;-6 -4 -6 -4 -2 -2 -2 -2 0]
ad=[ad;ones(1,size(ad,2))]
plot(ad(1,:),ad(2,:))
x1=-8:0.01:-4;
x2=-4:-0.01:-8;
y1=sqrt(4-abs(x1+6).^2)+2;
y2=-sqrt(4-abs(x1+6).^2)+2;
cem=[x1 x2;y1 y2];
plot(cem(1,:),cem(2,:))
cem=[cem;ones(1,size(cem,2))]
d=[1 7]'; d=[d;1]
t1=[1 0 -d(1,1);0 1 -d(2,1);0 0 1]
teta=((pi/2)-acot(-1))
t2=[cos(teta) -sin(teta) 0;sin(teta) cos(teta) 0;0 0 1]
t3=[-1 0 0;0 1 0;0 0 1]
t4=[cos(teta) sin(teta) 0;-sin(teta) cos(teta) 0;0 0 1]
t5=[1 0 d(1,1);0 1 d(2,1);0 0 1]
T=t5*t4*t3*t2*t1;
ncem=T*cem;
nad=T*ad;
plot(ncem(1,:),ncem(2,:)-12);plot(nad(1,:),nad(2,:)-12)

m3

Hiç yorum yok:

Yorum Gönder