Matlab极坐标画图

Matlab极坐标画图1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 %%==========在特殊坐标系中绘制特殊图形。=======…

 1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

17

18

19

20

21

22

23

24

25

26

27

28

29

30

31

%% ==========在特殊坐标系中绘制特殊图形。=======

%利用polar函数在极坐标系中绘制图形

figure;

theta=0:.1:pi;

rho1=sin(theta);

rho2=cos(theta);

subplot(1,3,1);

polar(theta,rho1,'.-r');

hold on;

polar(theta,rho2,'--g');

title('极坐标系中绘图');

%另外一种和极坐标有关系的坐标系就是柱坐标系了

theta=0:pi/100:3*pi;

rho=sin(theta)+cos(theta);

[t,r]=meshgrid(theta,rho);

z=r.*t;

subplot(1,3,2);

[x,y,z]=pol2cart(t,r,z);%极坐标系向柱坐标系转化

mesh(x,y,z);%柱坐标系中进行绘图

title('柱坐标系中绘图');

view([-65 30]);

%将球坐标系转换为柱面坐标系

subplot(1,3,3);

delta=pi/100;

theta=0:delta:pi; % theta is zenith angle

phi=0:delta:pi; % phi is azimuth angle

[t p]=meshgrid(theta,phi);

r=ones(size(t));

[x,y,z]=sph2cart(t,p,r);%球坐标向柱坐标转化

mesh(x,y,z);%球坐标系中进行绘图

title('球坐标系中绘图');

Matlab极坐标画图

今天的文章Matlab极坐标画图分享到此就结束了,感谢您的阅读,如果确实帮到您,您可以动动手指转发给其他人。

版权声明:本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 举报,一经查实,本站将立刻删除。
如需转载请保留出处:http://bianchenghao.cn/32558.html

(0)
编程小号编程小号

相关推荐

发表回复

您的电子邮箱地址不会被公开。 必填项已用*标注