If this page won't load the sage content, click here
The code below illustrates how a matrix transforms objects in the plane. It graphs both the unit square together with the image of the unit square under this transformation. It also graphs the unit circle together with the image of the unit circle.
- Notice that lines are always mapped to lines,
- The columns of the matrix are the edges of transformed parallelogram.
- The eigenvectors, if real, are draw in the map below as both the green and purple vectors. The green vector is the eigenvector whose length is 1 unit. The purple vector is the image of the green vector under the transformation.
Please adjust the values in the matrix below until you can give an answer the the following questions:
- What does the determinant tell you about the map?
- If the determinant is zero, what does that mean about your map?
- What do the eigenvalues tell you about your map? This is perhaps easiest to tell with the circle map, or with a diagonal matrix.
- Is there a connection between the eigenvalues and the determinant?
- What do the eigenvectors tell you?
- Does anything special happen if the matrix is symmetric?
A=matrix([ [2,1], [0,3] ]) EV=A.eigenvectors_right() e1=vector([1,0]) e2=vector([0,1]) c1,c2=A.columns() z=vector([0,0]) boxplot=arrow(z,e1,color='red',aspect_ratio=1) boxplot+=arrow(z,e2,color='blue') boxplot+=arrow(e2,e2+e1,color='red') boxplot+=arrow(e1,e1+e2,color='blue') boxplot+=arrow(z,c1,color='red',aspect_ratio=1) boxplot+=arrow(z,c2,color='blue') boxplot+=arrow(c2,c2+c1,color='red') boxplot+=arrow(c1,c1+c2,color='blue') evplot=arrow(z,z) for i in range(len(EV)): for j in range( len( EV[i][1] ) ): if EV[i][0]==EV[i][0].conjugate(): evplot+=arrow(z,EV[i][0]*(EV[i][1][j])/EV[i][1][j].norm(),color='purple') evplot+=arrow(z,(EV[i][1][j])/EV[i][1][j].norm(),color='green') evplot+=arrow(z,-EV[i][0]*(EV[i][1][j])/EV[i][1][j].norm(),color='purple') evplot+=arrow(z,-(EV[i][1][j])/EV[i][1][j].norm(),color='green') var('t') r=vector([cos(t),sin(t)]) circleplot=parametric_plot(r,(t,0,pi/2),fillcolor='yellow',fill=true) circleplot+=parametric_plot(A*r,(t,0,pi/2),fillcolor='yellow',fill=true) circleplot+=parametric_plot(r,(t,pi/2,pi),fillcolor='green',fill=true) circleplot+=parametric_plot(A*r,(t,pi/2,pi),fillcolor='green',fill=true) circleplot+=parametric_plot(r,(t,pi,3*pi/2),fillcolor='orange',fill=true) circleplot+=parametric_plot(A*r,(t,pi,3*pi/2),fillcolor='orange',fill=true) circleplot+=parametric_plot(r,(t,3*pi/2,2*pi),fillcolor='pink',fill=true) circleplot+=parametric_plot(A*r,(t,3*pi/2,2*pi),fillcolor='pink',fill=true) r=1/3*vector([(1 - sin(t))*cos(t)+1.5, (1 - sin(t))*sin(t)+2.5]) heart=parametric_plot( r, (t, pi/2, 3*pi/2),color='black',fill=true) heart+=parametric_plot( r, (t, -pi/2, pi/2),color='brown') heart+=parametric_plot( A*r, (t, pi/2, 3*pi/2),color='black',fill=true) heart+=parametric_plot( A*r, (t, -pi/2, pi/2),color='brown') table([ ["Matrix",A], ["Determinant",A.det()], ["Eigenvalues",A.eigenvalues()], ]) table([[ show(boxplot+heart),show(boxplot+evplot+circleplot) ]]) print "The eigenvectors are given below. Sage gives [(eigenvalue, [eigenvector], multiplicity), (eigenvalue, [eigenvector],multiplicity)]" EV
Here's another cell in case you want to compare two of these side by side.
<sagecell>
A=matrix([ [1,2], [2,4] ])
EV=A.eigenvectors_right()
e1=vector([1,0]) e2=vector([0,1]) c1,c2=A.columns() z=vector([0,0]) boxplot=arrow(z,e1,color='red',aspect_ratio=1) boxplot+=arrow(z,e2,color='blue') boxplot+=arrow(e2,e2+e1,color='red') boxplot+=arrow(e1,e1+e2,color='blue') boxplot+=arrow(z,c1,color='red',aspect_ratio=1) boxplot+=arrow(z,c2,color='blue') boxplot+=arrow(c2,c2+c1,color='red') boxplot+=arrow(c1,c1+c2,color='blue')
evplot=arrow(z,z)
for i in range(len(EV)):
for j in range( len( EV[i][1] ) ): if EV[i][0]==EV[i][0].conjugate(): evplot+=arrow(z,EV[i][0]*(EV[i][1][j])/EV[i][1][j].norm(),color='purple') evplot+=arrow(z,(EV[i][1][j])/EV[i][1][j].norm(),color='green') evplot+=arrow(z,-EV[i][0]*(EV[i][1][j])/EV[i][1][j].norm(),color='purple') evplot+=arrow(z,-(EV[i][1][j])/EV[i][1][j].norm(),color='green')
var('t') r=vector([cos(t),sin(t)]) circleplot=parametric_plot(r,(t,0,pi/2),fillcolor='yellow',fill=true) circleplot+=parametric_plot(A*r,(t,0,pi/2),fillcolor='yellow',fill=true) circleplot+=parametric_plot(r,(t,pi/2,pi),fillcolor='green',fill=true) circleplot+=parametric_plot(A*r,(t,pi/2,pi),fillcolor='green',fill=true) circleplot+=parametric_plot(r,(t,pi,3*pi/2),fillcolor='orange',fill=true) circleplot+=parametric_plot(A*r,(t,pi,3*pi/2),fillcolor='orange',fill=true) circleplot+=parametric_plot(r,(t,3*pi/2,2*pi),fillcolor='pink',fill=true) circleplot+=parametric_plot(A*r,(t,3*pi/2,2*pi),fillcolor='pink',fill=true)
r=1/3*vector([(1 - sin(t))*cos(t)+1.5, (1 - sin(t))*sin(t)+2.5]) heart=parametric_plot( r, (t, pi/2, 3*pi/2),color='black',fill=true) heart+=parametric_plot( r, (t, -pi/2, pi/2),color='brown') heart+=parametric_plot( A*r, (t, pi/2, 3*pi/2),color='black',fill=true) heart+=parametric_plot( A*r, (t, -pi/2, pi/2),color='brown')
table([ ["Matrix",A], ["Determinant",A.det()], ["Eigenvalues",A.eigenvalues()], ]) table([[ show(boxplot+heart),show(boxplot+evplot+circleplot) ]]) print "The eigenvectors are given below. Sage gives [(eigenvalue, [eigenvector], multiplicity), (eigenvalue, [eigenvector],multiplicity)]" EV
</sagecell>
You can also head to http://sagemath.org, create an account, and then copy the code above to your own notebook. Then you can create 10 of these plots all together and look for common patterns.
Here are the matrices referenced in the problem set.
[2,1],[0,3] [-2,1],[0,3] [-2,1],[0,-3] [0,4],[3,1] [2,1],[1,2] [1,2],[2,4] [0,-1],[1,0] [-1,2],[2,1] [cos(pi/3),-sin(pi/3)],[ sin(pi/3),cos(pi/3)] [3*cos(pi/6),-5*sin(pi/6)],[ 3*sin(pi/6),5*cos(pi/6)]