Re: formula for a rotation matrix
- To: mathgroup at smc.vnet.net
- Subject: [mg84757] Re: formula for a rotation matrix
- From: "Mariano Suárez-Alvarez" <mariano.suarezalvarez at gmail.com>
- Date: Sat, 12 Jan 2008 05:22:14 -0500 (EST)
- References: <fm9bfu$j5b$1@smc.vnet.net>
On Jan 12, 1:17 am, Yaroslav Bulatov <yarosla... at gmail.com> wrote: > I'm looking for a rotation matrix R that rotates vector 1,1,1,..,1 to > align with vector 0,0,...,0,1 in n dimensions. Since there may be many > such matrices, I'm looking for a one with the nicest symbolic > expression > > One possible formula is below, although it seems a bit complicated > since it involves 4 distinct values. Is it possible to get an > expression that is more symmetrical? > > let J=(n-1)x(n-1) matrix of 1's, I=(n-1)x(n-1) identity matrix, > j1=(n-1)x1 matrix of 1's, j2=1xn matrix of 1's > R=I-J/(sqrt(n)+n) ~Append~ -j1/(sqrt(n)) ~Append~ j2/(sqrt(n)) > > R[n_] := Module[{}, > (* make n-1 x n-1 subblock *) > J = ConstantArray[1, {n - 1, n - 1}]; > m = IdentityMatrix[n - 1] - J/(n + Sqrt[n]); > (* Append a column of -1/Sqrt[n]*) > m = m // Transpose // Append[#, Table[-1/Sqrt[n], {n - 1}]] & // > Transpose; > (* Append a row of 1/Sqrt[n] *) > m = Append[m, Table[1/Sqrt[n], {n}]] > ] This might work, up to a cyclic permutation of coordinates: B[n_] := B[n] = Table[ Which[ i == 1, 1/Sqrt[n], j == 1, -1/Sqrt[(n-i+1)(n-i+2)], i == j, Sqrt[(1 - i + n)/(2 - i + n)], i < j, -1/Sqrt[(n-i+1)(n-i+2)], True, 0 ], {i,1,n},{j,1,n} ]; This is just the matrix that you get from A[n_] :=Orthogonalize[ Prepend[ Rest@IdentityMatrix[n], Table[1,{n}] ] ]; -- m