MATLAB实验中球坐标系、笛卡尔坐标系和极坐标系间的转换

1 楼
sph2cart
cart2sph
cart2pol
pol2cart
其中sph为球坐标
cart为笛卡尔
pol为极坐标

例如:
m={-20 -50 50 2 4};
>> [a,b,r,w1,w2]=deal(m{:});
>> t=0:0.01:0.5;
>> a=a*pi/180;b=b*pi/180;w1=w1*pi*2;w2=w2*pi*2;
>> x1=a+w1*t;
>> x2=a+w2*t;
>> r=r*ones(1,length(t));
>> [x,y,z]=sph2cart(x1,x2,r);
>> plot3(x,y,z)
2016-04-25 09:35:42
a2392662922
2 楼
恢复搞活
2016-05-06 15:31:22