> with(LinearAlgebra): > # rotation parallel to the x-y plane, around the z-axis > Txy := Matrix(3,3,[ [cos(theta), -sin(theta), 0], > [sin(theta), cos(theta), 0], > [ 0, 0, 1]]); > [cos(theta) -sin(theta) 0] [ ] Txy := [sin(theta) cos(theta) 0] [ ] [ 0 0 1] > rotxy := proc(vec, angel) > # vec to be rotated by angel > MatrixVectorMultiply(subs(theta = angel, Txy) , vec); > end; > rotxy := proc(vec, angel) LinearAlgebra:-MatrixVectorMultiply( subs(theta = angel, Txy), vec) end proc > v := Vector([1,2,3]); [1] [ ] v := [2] [ ] [3] > vrot := rotxy(v, Pi/2); [-2] [ ] vrot := [ 1] [ ] [ 3] > Norm(v,2); sqrt(14) > Norm(vrot,2); sqrt(14) > with(plots): > k := 8: # number of frames > L := []: > for i from 0 to k do > plt[i] := polygonplot3d( > [convert(rotxy(Vector([1,0,0]), i*2*Pi/k),'vector'), > convert(rotxy(Vector([0,2,0]), i*2*Pi/k),'vector'), > convert(rotxy(Vector([0,0,3]), i*2*Pi/k),'vector') > ], > axes = normal, > style = patch, > orientation = [-25,75]): > L := [op(L), plt[i]]: > od: > Warning, the name changecoords has been redefined # In order to see the animation, click on the plot below with the right # mouse button and follow the Animation submenu. > display(L, insequence=true); >