布莱因瓶matlab,8字形 克莱因瓶 matlab

匿名用户

1级

2016-12-02 回答

n = 12;

a = .2; % the diameter of the small tube

c = .6; % the diameter of the bulb

t1 = pi/4 : pi/n : 5*pi/4; % parameter along the tube

t2 = 5*pi/4 : pi/n : 9*pi/4; % angle around the tube

u = pi/2 : pi/n : 5*pi/2;

[X,Z1] = meshgrid(t1,u);

[Y,Z2] = meshgrid(t2,u);

% The handle

len = sqrt(sin(X).^2 + cos(2*X).^2);

x1 = c*ones(size(X)).*(cos(X).*sin(X) ...

- 0.5*ones(size(X))+a*sin(Z1).*sin(X)./len);

y1 = a*c*cos(Z1).*ones(size(X));

z1 = ones(size(X)).*cos(X) + a*c*sin(Z1).*cos(2*X)./len;

handleHndl=surf(x1,y1,z1,X);

set(handleHndl,'EdgeColor',[.5 .5 .5]);

hold on;

% The bulb

r = sin(Y) .* cos(Y) - (a + 1/2) * ones(size(Y));

x2 = c * sin(Z2) .* r;

y2 = - c * cos(Z2) .* r;

z2 = ones(size(Y)) .* cos(Y);

bulbHndl=surf(x2,y2,z2,Y);

set(bulbHndl,'EdgeColor',[.5 .5 .5])

colormap(hsv);

axis vis3d

view(-37,30);

axis off

light('Position',[2 -4 5])

light

hold off

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值