Rotation group in 3D linear space has 3 parameters. There are different choices of parameters. The most popular choice in Mechanics i s Euler’s angles. In other domains of Physics other parameters are used. For example, in optic of crystals it’s useful vector parametrization of rotation group [1]. The aim of this post is application of Mathematica to vector parametrization of rotation group. It is based on the book Lorentz group (in Russian) [2].
1. Antisymmetric matrix in rotation matrix
1. Antisymmetric matrix in rotation matrix
In 3D linear space rotation is described by rotation matrix with properties
R.Transpose@R=IdentityMatrix[3],
(
1
)Det@R=1.
(
2
)We consider only rotations without reflection, hence Det@R = 1. In general case rotation matrix depends from 3 independent parameters. Same number of independent parameters has antisymmetric matrix in 3D linear space. So rotation matrix can be expressed as function of antisymmetric matrix aMat .
We define antisymmetric matrix A
In[]:=
A=Echo[SymmetrizedArray[{{1,2}a,{1,3}b,{2,3}c},{3,3},Antisymmetric[All]]//Normal," A = ",MatrixForm];
" A = "
0 | a | b |
-a | 0 | c |
-b | -c | 0 |
(
3
)Rotation matrix R as function of antisymmetric matrix A is
In[]:=
R=EchoEvaluation[IdentityMatrix[3]+2(A+A.A)/(1-1/2Tr[A.A])," Matrix R definition "->"R MatrixForm = ",MatrixForm];
«
" Matrix R definition "IdentityMatrix[3]+
2(A+A.A)
1-Tr[A.A]
1
2
(
4
)»
"R MatrixForm = "
1+ 2(- 2 a 2 b 1+ 1 2 2 a 2 b 2 c | 2(a-bc) 1+ 1 2 2 a 2 b 2 c | 2(b+ac) 1+ 1 2 2 a 2 b 2 c |
2(-a-bc) 1+ 1 2 2 a 2 b 2 c | 1+ 2(- 2 a 2 c 1+ 1 2 2 a 2 b 2 c | 2(-ab+c) 1+ 1 2 2 a 2 b 2 c |
2(-b+ac) 1+ 1 2 2 a 2 b 2 c | 2(-ab-c) 1+ 1 2 2 a 2 b 2 c | 1+ 2(- 2 b 2 c 1+ 1 2 2 a 2 b 2 c |
(
5
)We can check directly that rotation matrix (5) satisfies conditions (1) and (2).
In[]:=
EchoEvaluation[Simplify[R.Transpose@R]==IdentityMatrix[3],"Verification "->"Condition (1)"];EchoEvaluation[Simplify[Det@R]==1,"Verification "->"Condition (2)"];
«
"Verification "Simplify[R.Transpose[R]]IdentityMatrix[3]
(
6
)»
"Condition (1)"
True
(
7
)«
"Verification "Simplify[Det[R]]1
(
8
)»
"Condition (2)"
True
(
9
)2. Equivalence of antisymmetric matrix and vector in 3D linear space
2. Equivalence of antisymmetric matrix and vector in 3D linear space
Vector and antisymmetric matrix in 3D linear space have 3 independent parameters. We can pass from 3D vector to antisymmetric matrix and vice versa with Levi-Civita tensor. We define 3D vector
In[]:=
n=Echo[{nx,ny,nz}," n = "];
" n = "{nx,ny,nz}
(
10
)and associate with it antisymmetric matrix Nm
In[]:=
Nm=EchoEvaluation[-LeviCivitaTensor[3].n//Normal," Nm definition"->" Nm matrix form ",MatrixForm];
«
" Nm definition"Normal[-LeviCivitaTensor[3].n]
(
11
)»
" Nm matrix form "
0 | -nz | ny |
nz | 0 | -nx |
-ny | nx | 0 |
(
12
)The sign in Nm definition is chosen to have dot operation of Nm with any 3D vector equal to cross product of two vectors n and k
In[]:=
k=Echo[{kx,ky,kz}," k = "];EchoEvaluation[Simplify[Nm.k==Cross[n,k]]," verification "->" Result "];
" k = "{kx,ky,kz}
(
13
)«
" verification "Simplify[Nm.knk]
(
14
)»
" Result "
True
(
15
) We can return back to vector n from Nm by formula
In[]:=
EchoEvaluation[n==1/2*TensorContract[LeviCivitaTensor[3].Nm,{2,3}]," Verification"->" Result "];
«
" Verification"nTensorContract[LeviCivitaTensor[3].Nm,{2,3}]
1
2
(
16
)»
" Result "
True
(
17
)3. Vector parametrization of rotation group
3. Vector parametrization of rotation group
We take formula (4) and replace an antisymmetric matrix A by antisymmetric matrix Nm. The result is formula of vector parametrization of rotation matrix
In[]:=
R=Echo[IdentityMatrix[3]+2Simplify[(Nm+Nm.Nm)/(1-1/2Tr[Nm.Nm])]," R = ",MatrixForm];
" R = "
1- 2( 2 ny 2 nz 1+ 2 nx 2 ny 2 nz | 2(nxny-nz) 1+ 2 nx 2 ny 2 nz | 2(ny+nxnz) 1+ 2 nx 2 ny 2 nz |
2(nxny+nz) 1+ 2 nx 2 ny 2 nz | 1- 2( 2 nx 2 nz 1+ 2 nx 2 ny 2 nz | 2(-nx+nynz) 1+ 2 nx 2 ny 2 nz |
2(-ny+nxnz) 1+ 2 nx 2 ny 2 nz | 2(nx+nynz) 1+ 2 nx 2 ny 2 nz | 1- 2( 2 nx 2 ny 1+ 2 nx 2 ny 2 nz |
(
18
)Vector parameter n is invariant under action of rotation matrix R
In[]:=
EchoEvaluation[Simplify[R.n]==n," Verification"->" Result"];
«
" Verification"Simplify[R.n]n
(
19
)»
" Result"
True
(
20
)Hence, n is directed along rotation axis.
If we take z-axis along rotation axis rotation matrix R must give rotation in XY plane .
In[]:=
RXY=Echo[{{Cos[ϕ],-Sin[ϕ],0},{Sin[ϕ],Cos[ϕ],0},{0,0,1}}," RXY=",MatrixForm];
" RXY="
Cos[ϕ] | -Sin[ϕ] | 0 |
Sin[ϕ] | Cos[ϕ] | 0 |
0 | 0 | 1 |
(
21
)Rotation matrix R with vector parameter n must give same result if n is directed along z-axis. We use RXY to find
nzasfunctionofangleofrotationϕ
In[]:=
EchoEvaluation[SolveValues[(R/.{nx->0,ny->0})==RXY,nz]," Equation to solve "->" nz = ",#[[1]]&];
«
" Equation to solve "SolveValues[(R/.{nx0,ny0})RXY,nz]
(
22
)»
" nz = "
Tan
ϕ
2
(
23
)In this case . So, in cases when vector parameter n is not directed along axes angle of rotation ϕ its norm is given by formula
nzisequaltoNorm[n]
Norm[nVec]=Tan[ϕ].
(
24
)Rotation matrix with vector parameter n describes rotation around axis directed along vector n with angle in interval
-π<ϕ<π
(
25
) We can include value ϕ=π to vector parametrization. For ϕ=π norm of vector parameter nVec becomes infinity. So we take vector parameter n in the form n=α*e where e is unity vector
In[]:=
e=Echo[{ex,ey,ez}," e = "];
" e = "{ex,ey,ez}
(
26
)Antisymmetric matrix associated with vector e is Em
In[]:=
Em=EchoEvaluation[-LeviCivitaTensor[3].e//Normal," Em definition"->" Em matrix form ",MatrixForm];
«
" Em definition"Normal[-LeviCivitaTensor[3].e]
(
27
)»
" Em matrix form "
0 | -ez | ey |
ez | 0 | -ex |
-ey | ex | 0 |
(
28
)Matrix Nm = α*Em . We replace Nm by α*Em and calculate limit of rotation matrix R , when α ∞. We obtain matrix Rπ to rotate on π .
In[]:=
Rπ=EchoEvaluationSimplifyIdentityMatrix[3]+Limit2(α*Em+α^2*Em.Em)1-α^2Tr[Em.Em],α->Infinity,ex^2+ey^2+ez^2==1," Definition "->" Rπ MatrixForm ",MatrixForm;
1
2
«
" Definition "SimplifyIdentityMatrix[3]+,++1
α∞
2(αEm+Em.Em)
2
α
1-Tr[Em.Em]
1
2
2
α
2
ex
2
ey
2
ez
(
29
)»
" Rπ MatrixForm "
1-2 2 ey 2 ez | 2exey | 2exez |
2exey | -1+2 2 ey | 2eyez |
2exez | 2eyez | -1+2 2 ez |
(
30
)The matrix Rπ is symmetric
In[]:=
EchoEvaluation[Rπ==Transpose@Rπ," condition "->" result"];
«
" condition "RπTranspose[Rπ]
(
31
)»
" result"
True
(
32
)and satisfies condition (1)
In[]:=
EchoEvaluation[Simplify[Rπ.Rπ,ex^2+ey^2+ez^2==1]," Condition "->" Result ",MatrixForm];
«
" Condition "Simplify[Rπ.Rπ,++1]
2
ex
2
ey
2
ez
(
33
)»
" Result "
1 | 0 | 0 |
0 | 1 | 0 |
0 | 0 | 1 |
(
34
)Vector e is invariant under rotation by the matrix Rπ
In[]:=
EchoEvaluation[Simplify[Rπ.e==e,ex^2+ey^2+ez^2==1]," Condition "->" Result "];
«
" Condition "Simplify[Rπ.ee,++1]
2
ex
2
ey
2
ez
(
35
)»
" Result "
True
(
36
)A vector orthogonal to vector e is rotated on angle π. We can prove this by taking Z axis along vector e and vector k in XY plane
In[]:=
EchoEvaluation[Simplify[Rπ.{kx,ky,0}/.{ex->0,ey->0,ez->1}]," Rotation "->" Result k = "];
«
" Rotation "Simplify[Rπ.{kx,ky,0}/.{ex0,ey0,ez1}]
(
37
)»
" Result k = "
{-kx,-ky,0}
(
38
)Inverse problem search of vector parameter for rotation matrix R can be solved by formula
In[]:=
n=EchoEvaluation[Simplify[TensorContract[LeviCivitaTensor[3].R,{2,3}]/(Tr@R+1)]," Formula "->" Result n = "];
Formula (39) is valid only for rotation matrix with antisymmetric part. If rotation matrix is symmetric to find vector e we must find eigenvector with eigenvalue λ=1 and normalize it to unit vector.
Finally we find rule of composition of vector parameters. Vector parameter n2 of rotation matrix resulting from two rotations the first with vector parameter n and the second one with vector parameter n1 is given by simple formula
The formula (42) can be written in vector notation
References
References
1
.Теория гиротропии (Gyrotropie theory), Минск, 1976
2
.Группа Лоренца (Lorentz group) Москва, 1979.