*To*: Paul Anzel <panzel@caltech.edu>*Cc*: debian-laptop@lists.debian.org*Subject*: Re: Matrix rotation*From*: real bas <realbas89@gmail.com>*Date*: Fri, 8 May 2015 19:18:42 -0400*Message-id*: <[🔎] CAE5FUsYzWawjsZUmobmcp+_8XazAa=VQD-ARy4Ppr00XVJBdbw@mail.gmail.com>*In-reply-to*: <[🔎] 554D3968.1070704@caltech.edu>*References*: <[🔎] CAEu-QwLKy0HVoCaasDspQpFtLFLXjG_W-mChrORq0+6Pdc=T9A@mail.gmail.com> <[🔎] 20150508232431.6a51c2a4@acerCF> <[🔎] 554D3968.1070704@caltech.edu>

I guess you can use the operator % to index the columns. Look, if the vector column is [A, B, C] address by [0, 1, 2], u can use index i+1%3. The vector[2] goes to vector[0], vector[0] to vector[1] and vector [1] to vector[2] automatically.

2015-05-08 18:32 GMT-04:00 Paul Anzel <panzel@caltech.edu>:

Are you trying to cyclically permute the columns of a matrix? So for a

3x3 matrix of columns [A, B, C] you want [C, A, B]? Then you'd right

multiply (X_new = X*M) by a matrix M =

[0, 1, 0]

[0, 0, 1]

[1, 0, 0]

(generalizing to higher dimensions is trivial).

And yes, this is not a particularly debian-laptop appropriate question.

For math questions of this sort, I'd recommend browsing/posting at

https://math.stackexchange.com/

Archive: [🔎] 554D3968.1070704@caltech.edu" target="_blank">https://lists.debian.org/[🔎] 554D3968.1070704@caltech.edu

On 05/08/2015 02:24 PM, giulianc51 wrote:

> 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,

> giuliano

>

>

> 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;

>

>

--

To UNSUBSCRIBE, email to debian-laptop-REQUEST@lists.debian.org

with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org

**References**:**Matrix rotation***From:*Arghya Das <arghya0190@gmail.com>

**Re: Matrix rotation***From:*giulianc51 <giulianc51@gmail.com>

**Re: Matrix rotation***From:*Paul Anzel <panzel@caltech.edu>

- Prev by Date:
**Re: Matrix rotation** - Next by Date:
**Re: Matrix rotation** - Previous by thread:
**Re: Matrix rotation** - Next by thread:
**Re: Matrix rotation** - Index(es):