本算法包含了matlab的爱心的画法,快去给女神表白吧!
love1
clear;clc
b=0:0.01*pi:2*pi;
a=2;
r=a*(1-sin(b));
h=polarplot(b,r,'r');
box on
set(h,'LineWidth',3);
title({'公式1';'笛卡尔表白:p=a(1-sin(\theta))'});
love2
clear;clc
a=ezplot('x^2-abs(x)*y+y^2-15');
axis square
grid on
set(a,'color','r','LineWidth',3);
title({'公式2';'x^2-|x|y+y^2-15=0'});
love3
clear;clc
f=@(x,y,z)(x.^2+2.*y.^2+z.^2-1).^3-x.^2.*z.^3-0.1.*y.^2.*z.^3;
[x,y,z]=meshgrid(linspace(-3,3));
val=f(x,y,z);
[p,v]=isosurface(x,y,z,val,0);
1