1. 直线路径、圆形路径、S形路径、8字形曲线使用极坐标获得。
% shape I
t0=1:100;
rou0=0+t0*1;
fai0=pi/4+t0*0;
% shape O
t1=-0.49*pi:0.01*pi:0.5*pi;
rou1=2*10*cos(t1);
fai1=t1;
% shape S
t2=0.01:0.02*pi:2*pi;
rou2=sqrt(t2.*t2+sin(t2).*sin(t2));
fai2=atan(sin(t2)./t2);
% shape 8
a=2;
t3=0.01:0.02*pi:2*pi;
x=-a+a.*cos(t3)./(1+sin(t3).^2);
y=a.*sin(t3).*cos(t3)./(1+sin(t3).^2);
rou3=sqrt(x.^2+y.^2);
fai3=atan(y./x);
TJ = [rou0;fai0;rou1;fai1;rou2;fai2;rou3;fai3]';
5. 上述曲线的可视化
figure(1)
subplot(221)
plot(TJ(:,1).*cos(TJ(:,2)),TJ(:,1).*sin(TJ(:,2)),'o-y')
% xlabel("value");ylabel("value")
title("shape I")
subplot(222)
plot(TJ(:,3).*cos(TJ(:,4)),TJ(:,3).*sin(TJ(:,4)),'x-b')
% xlabel("value");ylabel("value")
title("shape O")
subplot(223)
plot(TJ(:,5).*cos(TJ(:,6)),TJ(:,5).*sin(TJ(:,6)),'d-c')
% xlabel("value");ylabel("value")
title("shape S")
subplot(224)
plot(TJ(:,7).*cos(TJ(:,8)),TJ(:,7).*sin(TJ(:,8)),'h-r')
% xlabel("value");ylabel("value")
title("shape 8")
6. 极坐标的曲线的绘制也可采用绘图函数
polarplot( theta, rho, LineSpec )
欢迎交流指正