2 - D Rotation

Clear["Global`*"]

m={{Cos[θ],-Sin[θ]},{+Sin[θ],Cos[θ]}};
m //MatrixForm

a={{-(I/(Sqrt[2])),(1/(Sqrt[2]))},{(I/(Sqrt[2])),(1/(Sqrt[2]))}}

ev=Normalize /@ Eigenvectors[m]

ev.m.Transpose[ev] //Simplify  //TrigToExp//MatrixForm

ev.m.Transpose[ev] //Simplify //MatrixForm

Transpose[ev].m.ev //Simplify //MatrixForm

vec={a,b};
vec //MatrixForm

m.vec //MatrixForm

xVec={1,0};
yVec={0,1};
m.xVec //MatrixForm
m.yVec //MatrixForm

makeVec[v_]:=Arrow[{{0,0},v}]

doPlot[θ_]:= {Blue,makeVec[xVec],makeVec[yVec],Red,makeVec[m.xVec],makeVec[m.yVec]} /.{x->θ Degree} //Graphics

doPlot[15]

2 - D  Eigenvalues and Eigenvectors

evals=Eigenvalues[m];
evals //TrigToExp

evecs=Eigenvectors[m]

m.evecs[[1]]

evals[[1]] evecs[[1]] //Simplify

3 - D Rotation

Clear["Global`*"]

m={{Cos[x],-Sin[x],0},{+Sin[x],Cos[x],0},{0,0,1}};
m //MatrixForm

vec={a,b,c};
vec //MatrixForm

m.vec //MatrixForm

xVec={1,0,0};
yVec={0,1,0};
zVec={0,0,1}
m.xVec //MatrixForm
m.yVec //MatrixForm
m.zVec //MatrixForm

makeVec[v_]:=Arrow[{{0,0,0},v}]

Clear[doPlot]
doPlot[θ_]:= {Blue,makeVec[xVec],makeVec[yVec],makeVec[zVec],Red,makeVec[m.xVec],makeVec[m.yVec],makeVec[m.zVec]} /.{x->θ Degree} //Graphics3D

doPlot[15]

3 - D  Eigenvalues and Eigenvectors

evals=Eigenvalues[m];
evals //TrigToExp

evecs=Eigenvectors[m]

m.evecs[[1]]

evals[[1]] evecs[[1]] //Simplify

Stretch

Clear["Global`*"]

m=DiagonalMatrix[{1,2}];
m //MatrixForm

Det[m]

vec={a,b};
vec //MatrixForm

m.vec //MatrixForm

xVec={1,0};
yVec={0,1};
m.xVec //MatrixForm
m.yVec //MatrixForm

makeVec[v_]:=Arrow[{{0,0},v}]

Clear[doPlot]
doPlot[θ_]:= {Thickness[0.04],Blue,makeVec[xVec],makeVec[yVec],Thickness[0.01], Red,makeVec[m.xVec],makeVec[m.yVec]} /.{x->θ Degree} //Graphics
doPlot[15]

Rotated Stretch

Stretch & Rotate

Clear["Global`*"]

m={{5/4,-(Sqrt[3])/4},{-(Sqrt[3])/4,7/4}};
m //MatrixForm

Det[m]

Eigenvalues[m]

ev=Eigenvectors[m]

makeVec[v_]:=Arrow[{{0,0},v}]

ev1=ev[[1]] //Normalize
ev2=ev[[2]] //Normalize

ev1p=m.ev[[1]] //Simplify
ev2p=m.ev[[2]]

Graphics[{
Opacity[0.7],LightYellow,Rotate[Rectangle[{0,0},{1,2}],π/6,{0,0}],
Opacity[1.0],Green,Rotate[Rectangle[{0,0},{1,1}],π/6,{0,0}],
GridLines->Automatic,Thickness[0.04],
Blue,makeVec[ev1],makeVec[ev2],Thickness[0.01], 
Red,makeVec[m.ev1],makeVec[m.ev2]},
GridLines->Automatic]

Un-Rotate

ev=Normalize /@ Eigenvectors[m];
ev //MatrixForm

ev.m.Transpose[ev] //MatrixForm

2 - D Rotation Angle:

Clear["Global`*"]

m[x_]={{Cos[x],-Sin[x]},{+Sin[x],Cos[x]}};
m[x] //MatrixForm

Tr[m[x]]

m[π/3] //MatrixForm

eq= 2 Cos[θ] ==Tr[ m[π/3]  ]

Solve[eq,θ]  /.{C[_]->0}//Normal

3 - D Rotation Angle

Clear["Global`*"]

m[x_]={{Cos[x],-Sin[x],0},{+Sin[x],Cos[x],0},{0,0,1}};
m[x] //MatrixForm

Tr[m[x]]

m[π/3] //MatrixForm

eq=Tr[ m[π/3]]== 2 Cos[θ]+1

Solve[eq,θ] /.{C[_]->0} //Normal

Euler Angles

Clear["Global`*"]

mx[θ_]={{1,0,0},{0,Cos[θ],-Sin[θ]},{0,+Sin[θ],Cos[θ]}};
my[θ_]={{Cos[θ],0,+Sin[θ]},{0,1,0},{-Sin[θ],0,Cos[θ]}};
mz[θ_]={{Cos[θ],-Sin[θ],0},{+Sin[θ],Cos[θ],0},{0,0,1}};
mx[θ] //MatrixForm
my[θ] //MatrixForm
mz[θ] //MatrixForm

euler=mz[θ1].mx[θ2].mz[θ3];
euler //MatrixForm

Det[euler] //Simplify

Eigenvalues[euler] //Simplify

tmp=Eigensystem[euler];
Dimensions[tmp]

tmp[[1,1]]

eVec=tmp[[2,1]]

euler.eVec- eVec //Simplify