theta = 0:0.01:2*pi; r = 1-sin(theta); polarplot(theta,r,"LineWidth",2,"Color","r");
方法二
方法二绘制出的图像如下:
1 2 3
f = @(x,y) x.^2 - abs(x).*y + y.^2 - 15; fimplicit(f, [-66-66],"LineWidth",2,"Color","r"); grid on
方法三
方法三绘制出的图像如下:
1 2 3
f = @(x,y) (x.^2+(y-(x.^2).^(1/3)).^2)-9; fimplicit(f, [-55-55],"LineWidth",2,"Color","r"); grid on
方法四
方法四能绘制三维的爱心图像:
1 2 3 4 5
colormap("turbo"); f = @(x,y,z) (x.^2+2*y.^2+z.^2-1).^3-(x.^2).*(z.^3)-0.1*(y.^2).*(z.^3); fimplicit3(f,"MeshDensity",60,"EdgeColor","none"); daspect([111]); grid on