How to rotate a curve in the xz-plane around z axis?
2 ビュー (過去 30 日間)
古いコメントを表示
I have a curve difined in a vector M with values in x and z position. I use "plot3" to plot this but now I want to rotate this curve around some axis, preferable z-axis so that it creates a body. In my case it will have a shape of a mountain.
Is this possible?
0 件のコメント
回答 (1 件)
Jan
2013 年 1 月 30 日
編集済み: Jan
2013 年 1 月 30 日
Rotation around the Z-axis by the angle a:
R = [ cos(a), sin(a), 0; ...
-sin(a), cos(a), 0; ...
0, 0, 1];
Points = rand(3, 100);
RotatedPoints = R * Points;
3 件のコメント
Jan
2013 年 1 月 30 日
Subtract the translation before rotating and add the translation afterwards again.
参考
カテゴリ
Help Center および File Exchange で Line Plots についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!