matlab做点散开的动图,求大神指点绘制空间内散点图的包络面,,,散点程序如下...

该楼层疑似违规已被系统折叠 隐藏此楼查看此楼

E=[];a=0;b=0;c=0;

for Zp=-50:2:50

for Xp=-200:2:200

for Yp=-200:2:200

P1_1=[cos(b)*cos(c) -cos(b)*sin(c) sin(b) Xp;sin(a)*sin(b)*cos(c)+cos(a)*sin(c) cos(a)*cos(c)-sin(a)*sin(b)*sin(c) -sin(a)*cos(b) Yp;sin(a)*sin(c)-cos(a)*sin(b)*cos(c) cos(a)*sin(b)*sin(c)+sin(a)*cos(c) cos(a)*cos(b) Zp;0 0 0 1]*[42.01;50.25;0;1]+[0;0; -208.897;0];

P2_1=[cos(b)*cos(c) -cos(b)*sin(c) sin(b) Xp;sin(a)*sin(b)*cos(c)+cos(a)*sin(c) cos(a)*cos(c)-sin(a)*sin(b)*sin(c) -sin(a)*cos(b) Yp;sin(a)*sin(c)-cos(a)*sin(b)*cos(c) cos(a)*sin(b)*sin(c)+sin(a)*cos(c) cos(a)*cos(b) Zp;0 0 0 1]*[-42.01;50.25;0;1]+[0;0; -208.897;0];

P3_1=[cos(b)*cos(c) -cos(b)*sin(c) sin(b) Xp;sin(a)*sin(b)*cos(c)+cos(a)*sin(c) cos(a)*cos(c)-sin(a)*sin(b)*sin(c) -sin(a)*cos(b) Yp;sin(a)*sin(c)-cos(a)*sin(b)*cos(c) cos(a)*sin(b)*sin(c)+sin(a)*cos(c) cos(a)*cos(b) Zp;0 0 0 1]*[-64.52;11.26;0;1]+[0;0; -208.897;0];

P4_1=[cos(b)*cos(c) -cos(b)*sin(c) sin(b) Xp;sin(a)*sin(b)*cos(c)+cos(a)*sin(c) cos(a)*cos(c)-sin(a)*sin(b)*sin(c) -sin(a)*cos(b) Yp;sin(a)*sin(c)-cos(a)*sin(b)*cos(c) cos(a)*sin(b)*sin(c)+sin(a)*cos(c) cos(a)*cos(b) Zp;0 0 0 1]*[-22.51;-61.51;0;1]+[0;0; -208.897;0];

P5_1=[cos(b)*cos(c) -cos(b)*sin(c) sin(b) Xp;sin(a)*sin(b)*cos(c)+cos(a)*sin(c) cos(a)*cos(c)-sin(a)*sin(b)*sin(c) -sin(a)*cos(b) Yp;sin(a)*sin(c)-cos(a)*sin(b)*cos(c) cos(a)*sin(b)*sin(c)+sin(a)*cos(c) cos(a)*cos(b) Zp;0 0 0 1]*[22.51;-61.51;0;1]+[0;0; -208.897;0];

P6_1=[cos(b)*cos(c) -cos(b)*sin(c) sin(b) Xp;sin(a)*sin(b)*cos(c)+cos(a)*sin(c) cos(a)*cos(c)-sin(a)*sin(b)*sin(c) -sin(a)*cos(b) Yp;sin(a)*sin(c)-cos(a)*sin(b)*cos(c) cos(a)*sin(b)*sin(c)+sin(a)*cos(c) cos(a)*cos(b) Zp;0 0 0 1]*[64.52;11.26;0;1]+[0;0; -208.897;0];

ZB1_1=P1_1(3)+sqrt(223^2-(P1_1(1)-27.15)^2-(P1_1(2)-126.87)^2);

ZB2_1=P2_1(3)+sqrt(223^2-(P2_1(1)+27.15)^2-(P2_1(2)-126.87)^2);

ZB3_1=P3_1(3)+sqrt(223^2-(P3_1(1)+123.45)^2-(P3_1(2)+39.92)^2);

ZB4_1=P4_1(3)+sqrt(223^2-(P4_1(1)+96.29)^2-(P4_1(2)+86.95)^2);

ZB5_1=P5_1(3)+sqrt(223^2-(P5_1(1)-96.29)^2-(P5_1(2)+86.95)^2);

ZB6_1=P6_1(3)+sqrt(223^2-(P6_1(1)-123.45)^2-(P6_1(2)+39.92)^2);

if ((ZB1_1<=50)&&(ZB2_1<=50)&&(ZB3_1<=50)&&(ZB4_1<=50)&&(ZB5_1<=50)&&(ZB6_1<=50)&&(ZB1_1>=(-50))&&(ZB2_1>=(-50))&&(ZB3_1>=(-50))&&(ZB4_1>=(-50))&&(ZB5_1>=(-50))&&(ZB6_1>=(-50)))

P0_1=[cos(b)*cos(c) -cos(b)*sin(c) sin(b) Xp;sin(a)*sin(b)*cos(c)+cos(a)*sin(c) cos(a)*cos(c)-sin(a)*sin(b)*sin(c) -sin(a)*cos(b) Yp;sin(a)*sin(c)-cos(a)*sin(b)*cos(c) cos(a)*sin(b)*sin(c)+sin(a)*cos(c) cos(a)*cos(b) Zp;0 0 0 1]*[0;0;0;1]+[0;0; -208.897;0];

E=[E,P0_1];

end

end

end

end

Xp0_1=E(1,:);

Yp0_1=E(2,:);

Zp0_1=E(3,:);

plot3(Xp0_1,Yp0_1,Zp0_1,'.');

xlabel('x');ylabel('y');zlabel('z');

grid on

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值