[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Matrix rotation

Il giorno Sat, 9 May 2015 01:21:44 +0530
Arghya Das <arghya0190@gmail.com> ha scritto:

Hi Arghya,
(sorry for my bad english)

> Does anyone know how to rotate a 2d matrix circularly for 'n' times in
> suppose C language...? It would be a lot of help if you could explain
> with code.

I don't understand your expression "rotate a 2d matrix circularly"; as
Jan-Rens explained you, you can build a matrix
	M = | cos(theta) sin(theta)|
	    |-sin(theta) cos(theta)|
and a vector
	X = | x |
	    | y |
(in linear algebra the vectors are column-wise); if you repeat the
multiplication X = M*X you have a series of vectors X, each rotating a
theta angle respect to the previous one;

best regards,

PS: if you want you can operate with row vectors using the
transposition X = X*transpose(M), but normally, as I said, the vectors
are disposed as column;

Reply to: