I have a matrix of vectors e.g.
mat1 = Table[Table[RandomReal[1], 2], n, n];
which is actually a matrix of cartesian coordiantes (x,y)
. I want to rotate the coordinate system multiplying each vector by a rotation matrix. I'm using
matRot = Map[RotationMatrix[3 Degree].# &, mat1, {2}];
However, this is very slow for larger matrices such as n = 2048
. I believe there is a more efficient way.
Map[RotationTransform[3. Degree], mat1, {2}]
is still slow but faster. $\endgroup$