不同形状的极坐标曲线绘制

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 )

欢迎交流指正

 

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值