MATLAB怎样画维维安尼

来源:学生作业帮助网 编辑:作业帮 时间:2024/04/28 23:59:05
MATLAB怎样画维维安尼

MATLAB怎样画维维安尼
MATLAB怎样画维维安尼

MATLAB怎样画维维安尼
t=linspace(0,2*pi,73);
r=1;
x=r*sin(t).^2;
y=r*sin(t).*cos(t);
z=r*cos(t);
plot3(x,y,z)%维维安尼曲线
hold on
q=linspace(-1,1,73);
[t,q]=meshgrid(t,z);
mesh(r/2*(cos(t)+1),r/2*sin(t),q,'edgecolor','none','facecolor','r')
[x,y,z]=sphere(73);
mesh(x,y,z,'edgecolor','none','facecolor','y');
axis equal off;lighting gouraud;alpha .2;camlight headlight
h=legend('维维安尼曲线','圆柱面','球面','location','northoutside','Orientation','horizontal');
set(h,'color','none','box','off')