Set new origin in polar coordinates
36 ビュー (過去 30 日間)
古いコメントを表示
Hi, I have a set of data in polar coordinates (r, theta). The default origin for matlab is (0,0). How I can change the origin to other points, such as (0,3)?
Thanks a lot.
採用された回答
Ameer Hamza
2020 年 5 月 18 日
編集済み: Ameer Hamza
2020 年 5 月 18 日
One of the easiest ways I can think of is to convert the points from polar to cartesian, do the translation, and then convert back to polar. For example
r = 1;
theta = linspace(0, 2*pi, 100);
translate = [0 3];
x = r*cos(theta) + translate(1);
y = r*sin(theta) + translate(2);
r_trans = hypot(y, x);
theta_trans = atan2(y, x);
polarplot(theta_trans, r_trans)
Original:
Translated:
その他の回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で Polar Plots についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!