Getting a new rotation matrix from an existing one by rotating an angle about a certain axis
3 ビュー (過去 30 日間)
古いコメントを表示
I have a large set of rotation matrices from which I am trying to generate another set of rotation matrices by rotating the existing ones about certain axes by angles 1-180 degrees. So rotation matrix A would be [a11, a12, a13; a21, a22, a23; a31, a32, a33], and the B rotation matrices would be obtained by rotating A about the, say, [1 1 1] axis by angles of 1-180 degrees. Is there a way to do this that already exists? I haven't been able to find it.
0 件のコメント
回答 (1 件)
Aparajith Raghuvir
2021 年 6 月 21 日
It is my understanding that you are looking for a function that can rotate an object about an axis by a specific angle.
The rotate function should serve your needs. You can input a rotation matrix, an axis, and an angle alpha to rotate by.
rotate(h, direction, alpha)
where h is the object to be rotated.
2 件のコメント
Aparajith Raghuvir
2021 年 6 月 22 日
"Too many output arguments." error comes up because the rotate function doesn't have an output you can assign.
Further it was built for graphics objects, so you would need to cast rotma as an image and run it as follows:
rotate(image(rotma), [1 1 1], 60);
This will result in a figure being plotted and opened. However, since there is no ouput, fetching the values of the modified matrix needs a workaround which I have suggested below:
- Run the following command
edit rotate
- This will open up the code for the rotate function.
- Use the code to understand how the rotated values are computed.
- You will notice that 'newxyz' variable contains the rotated matrix which you can use.
- You can create your own function with the same code which returns 'newxyz' as output which you can use further in your workflow.
I hope this helps.
参考
カテゴリ
Help Center および File Exchange で 3-D Scene Control についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!