22 Nisan 2010 Perşembe

Matlab ile Küpün içine Çember ve Üçgen Çizen Kod

m16

%www.ethemsulan.com
subplot(2,2,1)
axis([-10 10 -10 10 -10 10])
hold on
grid on
dik=[-10 10 10 10 10 -10 -10 -10;10 10 10 -10 -10 -10 -10 10
    ;-10 -10 -10 -10 -10 -10 -10 -10];
plot3(dik(1,:),dik(2,:),dik(3,:))
plot3(dik(1,:),dik(2,:),dik(3,:)+20)
hold on
grid on
ken=[-10 -10;-10 -10;-10 10];
plot3(ken(1,:),ken(2,:),ken(3,:))
plot3(-ken(1,:),ken(2,:),ken(3,:))
plot3(ken(1,:),-ken(2,:),ken(3,:))
plot3(-ken(1,:),-ken(2,:),ken(3,:))
hold on
z=0:pi/50:2*pi;
x=10*sin(z);
y=10*cos(z);
cem=[x;y;z]
plot3(cem(1,:),cem(2,:),cem(3,:)*0-10)
plot3(cem(1,:),cem(2,:),cem(3,:)*0+10)
hold on
yan=[0 0;-10 -10;-10 10];
plot3(yan(1,:),yan(2,:),yan(3,:))
plot3(yan(1,:),-yan(2,:),yan(3,:))
plot3(-yan(2,:),yan(1,:),yan(3,:))
plot3(yan(2,:),yan(1,:),yan(3,:))
ucgen=[-10 10 10 0 0 -10;0 0 0 0 0 0;-10 -10 -10 0 0 -10];
plot3(ucgen(1,:),ucgen(2,:),ucgen(3,:))
plot3(ucgen(2,:),ucgen(1,:),ucgen(3,:))
%ikşnci sekil
subplot(2,2,2)
axis([-10 10 -10 10 -10 10])
hold on
plot3(dik(1,:),dik(2,:),dik(3,:))
plot3(dik(1,:),dik(2,:),dik(3,:)+20)
hold on
plot3(ken(1,:),ken(2,:),ken(3,:))
plot3(-ken(1,:),ken(2,:),ken(3,:))
plot3(ken(1,:),-ken(2,:),ken(3,:))
plot3(-ken(1,:),-ken(2,:),ken(3,:))
grid on
plot3(cem(3,:)*0-10,cem(1,:),cem(2,:))
plot3(cem(3,:)*0+10,cem(1,:),cem(2,:))
hold on
plot3(yan(3,:),yan(1,:),yan(2,:))
plot3(yan(3,:),yan(1,:),-yan(2,:))
plot3(yan(3,:),-yan(2,:),yan(1,:))
plot3(yan(3,:),yan(2,:),yan(1,:))
hold on
plot3(ucgen(3,:),ucgen(1,:),ucgen(2,:))
plot3(ucgen(3,:),ucgen(2,:),ucgen(1,:))
%ucuncu sekil
subplot(2,2,3)
axis([-10 10 -10 10 -10 10])
hold on
grid on
plot3(dik(1,:),dik(2,:),dik(3,:))
plot3(dik(1,:),dik(2,:),dik(3,:)+20)
hold on
plot3(ken(1,:),ken(2,:),ken(3,:))
plot3(-ken(1,:),ken(2,:),ken(3,:))
plot3(ken(1,:),-ken(2,:),ken(3,:))
plot3(-ken(1,:),-ken(2,:),ken(3,:))
hold on
plot3(cem(2,:),cem(3,:)*0-10,cem(1,:))
plot3(cem(2,:),cem(3,:)*0+10,cem(1,:))
hold on
plot3(yan(2,:),yan(3,:),yan(1,:))
plot3(-yan(2,:),yan(3,:),yan(1,:))
plot3(yan(1,:),yan(3,:),-yan(2,:))
plot3(yan(1,:),yan(3,:),yan(2,:))
hold on
plot3(ucgen(1,:),-ucgen(3,:),-ucgen(2,:))
plot3(ucgen(2,:),-ucgen(3,:),-ucgen(1,:))

Hiç yorum yok:

Yorum Gönder