matlab 座標系轉換

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)





 

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章