I am trying to rotate an "orbit" using rotation matrix given below:
[cos(angle) -sin(angle) 0;
sin(angle) cos (angle) 0;
0 0 1 ]
First thing I thought I should do was to use sphere():
[x y z] = sphere;
Then concatenate x, y, and z together in a vector:
xyz = [x; y; z];
rotatMat = [cos(angle) -sin(angle) 0; sin(angle) cos (angle) 0; 0 0 1 ];
multiply rotation matrix and xyz to rotate an orbit:
rotated = rotatMat .* xyz;
However, xyz
turns out to be 62x22
dimension while my rotatMat
is only 3x3
so I cannot multiply them together.
How can i fix this issue?
Thank you in advance.