How can I rotate a set of points around an axis?
6 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Jonathan Babitsch
am 8 Jun. 2020
Kommentiert: Jonathan Babitsch
am 8 Jun. 2020
Hi everybody,
I have a question concerning a mathematical problem that I would like to solve.
If I have a Matrix 8x3, and like every line in the matrix describes a point, how can i rotate all the points in the matrix for example around the z axis?
I have tried it with a rotaionmatrix, but does that work? What does my code need to look like?
I'm sorry I don't really know how to do that. I have the following:
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/312608/image.png)
Above is the Code where I calculate the rotation matrix, and here is the set of points I would like to rotate:
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/312611/image.png)
Thanks a lot for your replies in advance, I'm glad for any help. I'm new to Matlab so I don't really know how to do this.
Have a nice evening,
Johnny
0 Kommentare
Akzeptierte Antwort
James Tursa
am 8 Jun. 2020
Bearbeitet: James Tursa
am 8 Jun. 2020
Arrange your points as column vectors and do a matrix multiply. E.g.,
result = rotmxXYZ * K.';
The result will have your points as column vectors also.
If you really need them in rows, then transpose result, or do this:
result = K * rotmxXYZ';
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Resizing and Reshaping Matrices finden Sie in Help Center und File Exchange
Produkte
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!