作业帮 > 英语 > 作业

用matlab 吧这个方程的三维图画出来~

来源:学生作业帮 编辑:作业帮 分类:英语作业 时间:2024/06/03 05:34:11
用matlab 吧这个方程的三维图画出来~
就是这个方程
(爱的方程式)
(x^2+9/4y^2+z^2-1)^3-x^2*z^3-9/80y^2z^3 =0其中-3
I did this before, so just give you the codes I wrote, try this:
%%This file creates a 3-d red heart with an equation
[x,y,z]=meshgrid(linspace(-3,3,120));
f=(x.^2+(9*y.^2)./4+z.^2-1).^3-((9*y.^2).*(z.^3))./80-(x.^2).*(z.^3);
p=patch(isosurface(x,y,z,f,0));
set(p,'FaceColor','r')
grid on
daspect([1 1 1])
view(3)
camlight('right')
camlight('left')
camlight('headlight')
lighting phong
xlabel('X')
ylabel('Y')
zlabel('Z')
title('Heart of Math')