フィルターのクリア

What should I do if I want to rotate a line?

5 ビュー (過去 30 日間)
Donghui  Sun
Donghui Sun 2013 年 10 月 23 日
回答済み: Friedrich 2013 年 10 月 23 日
For example, we have line : y = 2*x; I want to rotate the line by 30 degrees in a counterclockwise direction.
What should I do ? Any suggestions?
  1 件のコメント
Walter Roberson
Walter Roberson 2013 年 10 月 23 日
Rotate it around which point?

サインインしてコメントする。

採用された回答

Friedrich
Friedrich 2013 年 10 月 23 日
Hi,
In the case its rotating around the origin see here.
f = @(x) 2*x;
x = 0:0.1:10;
angl = 90;
rot_mat = @(angl) [cos(angl) -sin(angl); sin(angl) cos(angl)];
mat = rot_mat(deg2rad(angl));
f_rot = mat*[x;x*2];
plot(x,f(x),f_rot(1,:),f_rot(2,:));
legend('original','rotated')

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangePoint Cloud Processing についてさらに検索

タグ

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by