MATLAB怎样画维维安尼

来源:学生作业帮助网 编辑:六六作业网 时间:2024/11/08 18:28:45
MATLAB怎样画维维安尼MATLAB怎样画维维安尼MATLAB怎样画维维安尼t=linspace(0,2*pi,73);r=1;x=r*sin(t).^2;y=r*sin(t).*cos(t);z=

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')