聘我网

新概念招聘3.0

如何用MATLAB画这种心形图?

vote up0vote downstar

alt text

也就是给出极坐标式,如何画图?

 

1 个答复

vote up0vote downcheck

使用pol2cart将极坐标转化为笛卡尔坐标即可:

t = -pi:0.1:pi;
r = ((sin(t).*sqrt(abs(cos(t))))./(sin(t) + (7/5))) - 2*sin(t) + 2 ;
[x,y] = pol2cart(t,r);
plot(x,y)

或者:

t = -pi:0.1:pi;
r = ((sin(t).*sqrt(abs(cos(t))))./(sin(t) + (7/5))) - 2*sin(t) + 2 ;
polar(t,r)
链接

您的回答





不是您要找的问题? 浏览其他含有标签 的问题或者 自己问个.