Ch-3.1-C-32-New-박종우

1901 days ago by matrix

A=matrix([[1,0,0], [0,1,0],[3,2,1]]) B=matrix([[1,0,0], [0,2,0],[0,0,3]]) print "A^2=" print A^2 print "A^3=" print A^3 print "B^2=" print B^2 print "B^3=" print B^3 
       
A^2=
[1 0 0]
[0 1 0]
[6 4 1]
A^3=
[1 0 0]
[0 1 0]
[9 6 1]
B^2=
[1 0 0]
[0 4 0]
[0 0 9]
B^3=
[ 1  0  0]
[ 0  8  0]
[ 0  0 27]
A^2=
[1 0 0]
[0 1 0]
[6 4 1]
A^3=
[1 0 0]
[0 1 0]
[9 6 1]
B^2=
[1 0 0]
[0 4 0]
[0 0 9]
B^3=
[ 1  0  0]
[ 0  8  0]
[ 0  0 27]