Matrices and colors

I. Cnop
icnop@vub.ac.be

Load coloring package

<<Graphics`ArgColors`

Clear[un]

howMany = 24

Here we once more define directions on the unit circle:

un(
        k_) := (E^(((2 π I k)/(4 howMany))))

Show[
	Graphics[
		Table[
   			{ArgColor[un[4 j]],
   				Disk[{Re[un[j]], Im[un[j]]}, 0.06]},
  		 {j, howMany}]
  		 , AspectRatio -> Automatic
  		]
  	]

Action of a matrix on complex directions

Clear[A]

a = 1.2;
b =  .5;
c =  .7;
d = 1.5;

A=(({{a, b}, {c, d}}));

A // MatrixForm

Show[
	Graphics[
		{Table[
   			{ArgColor[un[4 j]],
   				Disk[A.{Re[un[j]], Im[un[j]]}, .04]},
  		 {j, howMany}],
  		 Table[
   			{ArgColor[un[4 j]],
   				Disk[{Re[un[j]], Im[un[j]]}, 0.03]},
  		 {j, howMany}]}
  		 , AspectRatio -> Automatic,Axes->True
  		]
  	]

Look for eigenvectors: directions that are preserved

Eigensystem[A] // ColumnForm

Show[
	Graphics[
		{Table[
   			{ArgColor[un[4 j]],
   				Line[{{0,0},A.{Re[un[j]], Im[un[j]]}}]},
  		 {j, howMany}],
  		 Table[
   			{ArgColor[un[4 j]],
   				Line[{{0,0},{Re[un[j]], Im[un[j]]}}]},
  		 {j, howMany}]}
  		 , AspectRatio -> Automatic,Axes->True
  		]
  	]

id=(({{1., 0}, {0, 1.}}))

Clear[lines]

lines[j_] := {Line[{{0, 0}, A . {Re[un[j]],  Im[un[j]]}}], 
        Line[{{0, 0}, id . {Re[un[j]],  Im[un[j]]}}]}

all = Table[lines[j], {j, 0, howMany}];

Do[
Show[
	Graphics[{Hue[4 k/howMany],lines[k]}]
  	, AspectRatio -> Automatic,PlotRange->{{-2,2},{-2,2}},Axes->True
  		]
  	,{k,0,2 howMany}]

Opposite vectors are found using the lower halfplane. Continue the animation for a full turn:

Do[
Show[
	Graphics[{Hue[4 k/howMany],lines[k]}]
  	, AspectRatio -> Automatic,PlotRange->{{-2,2},{-2,2}},Axes->True
  		]
  	,{k,2 howMany,4 howMany}]