心形MATLAB程序(完全可以运行)

整理文档很辛苦,赏杯茶钱您下走!

免费阅读已结束,点击下载阅读编辑剩下 ...

阅读已结束,您可以下载文档离线阅读编辑

资源描述

clf;clc;clear;closeall;figure(1);%用极坐标的形式实现%r=a(1-sinθ)x=-pi:pi/1000:pi;y=2*(1-sin(x));polar(x,y,'r-');title('\fontsize{16}ToSmallWhite');xlabel('\fontsize{16}\copyrightDingQian');figure(2);%用隐函数的形式实现%(x^2+(9/4)y^2+z^2-1)^3-x^2z^3-(9/80)y^2z^3=0-3=x,y,z=3[x,y,z]=meshgrid(linspace(-3,3));%做出网格meshgridp=(x.^2+(9/4)*y.^2+z.^2-1).^3-x.^2.*z.^3-(9/80)*y.^2.*z.^3;%实现结果的表达isosurface(x,y,z,p,0);%使用函数做图meshsurfaxisequal;axisoff;view(0,45);%视角的控制colormap([100]);%绘图颜色红色brighten(0.5);%增亮camlightright;%光源位置lightingphong;%光照模式title('\fontsize{16}ToSmallWhite');xlabel('\fontsize{16}\copyrightDingQian');text(-0.37,0.75,1,'\fontsize{16}\copyrightDingQian');figure(3);isosurface(x,y,z,p,0);view(0,45);colormap([10.20.2]);axisoff;axisequal;title('\fontsize{16}ToSmallWhite');text(-0.37,0.75,1.20,'\fontsize{16}\copyrightDingQian');figure(4);isosurface(x,y,z,p,0);view(-10,24);colormap([10.20.2]);axisoff;axisequal;title('\fontsize{16}ToSmallWhite');text(-0.37,0.75,1.20,'\fontsize{16}\copyrightDingQian');figure(5);isosurface(x,y,z,p,0);view(-10,24);colormap([100]);axisoff;axisequal;title('\fontsize{16}ToSmallWhite');text(-0.37,0.75,1.20,'\fontsize{16}\copyrightDingQian');figure(6);isosurface(x,y,z,p,0);view(1,11);colormap([100]);axisoff;axisequal;title('\fontsize{16}ToSmallWhite');

1 / 2
下载文档,编辑使用

©2015-2020 m.777doc.com 三七文档.

备案号:鲁ICP备2024069028号-1 客服联系 QQ:2149211541

×
保存成功