matlab 坐标系转换
程序员文章站
2022-07-12 10:08:02
...
1、极坐标转化为直角坐标 cart2pol
cart2pol:
[theta,rho] = cart2pol(x,y)
[theta,rho,z] = cart2pol(x,y,z)
theta:与X轴正半轴的夹角,为弧度 rho: 与原点的距离
[theta,rho] = cart2pol(sqrt(3),1)
theta =
0.5236
rho =
2.0000
>> [theta,rho,z] = cart2pol(sqrt(3),1,2)
theta =
0.5236
rho =
2.0000
z =
2
2、直角坐标转化为极坐标 pol2cart
pol2cart
[x,y] = pol2cart(theta,rho)
[x,y,z] = pol2cart(theta,rho,z)