Rotate co ordinates by a rotation matrix.
Ältere Kommentare anzeigen
I have a set of x and y co ordinates which make up a random shape. I want to be able to rotate the shape 360 degrees in an animation. To do this i want to multiply the co ordinates by a rotation matrix and then i will set the co ordinates of the shape to these which will rotate the shape by that amount.
I have my rotation matrix
rot = [cos(5),sin(5);-sin(5),cos(5)];
and then i try to multiply the coordinates like this.
xCor = rot*xCor; yCor = rot*yCor;
I get an error saying the inner matrix dimensions must agree. How would i go about getting this to work, or is there a better way to achieve this?
Akzeptierte Antwort
Weitere Antworten (1)
Andy
am 4 Apr. 2013
1 Stimme
Kategorien
Mehr zu Text Analytics Toolbox finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!