MATLAB心形图

2022-05-21 09:13:13   文档大全网     [ 字体: ] [ 阅读: ]

#文档大全网# 导语】以下是®文档大全网的小编为您整理的《MATLAB心形图》,欢迎阅读!
心形,MATLAB
clc; const=0;

x=-5:0.05:5;y=-5:0.05:5;z=-5:0.05:5; [x,y,z]=meshgrid(x,y,z);

f=(x.^2 + (9/4)*y.^2 + z.^2 - 1).^3 - x.^2.*z.^3 - (9/80)*y.^2.*z.^3-const; p=patch(isosurface(x,y,z,f,0));

set(p, 'FaceColor', 'red', 'EdgeColor', 'none'); daspect([1 1 1]) view(3)

camlight; lighting phong



三维



t=linspace(0,2*pi,501);

t=linspace(0.5*pi,1.5*pi,500); plot(t.*cos(t),t.*sin(t),'rp'); hold

plot(-t.*cos(t),t.*sin(t),'ro'); axis equal

二维


本文来源:https://www.wddqxz.cn/11cca73caf1ffc4fff47ac49.html

相关推荐