A=matrix([[2/3,1/3,2/3],[-2/3,2/3,1/3],[1/3,2/3,-2/3]])
print A
C=matrix([[x,0,0],[0,x,0],[0,0,x]])
print C
if ( A.is_invertible()==true):
    if(A.transpose()==A.inverse()):
        print "matrix is orthogonal "
    else:
        print "matrix is not orthogonal"
else:
    print"matrix is not orhtogonal"
B=A-C
print B
Q=B.det()
expand(Q)
Z=[]
Z=solve([Q],x)
print Z
F=[]
F=A.eigenvalues()
for f in F:
    if f.imag():
        print f, "Complex"
    else:
        print f, "Complex coefficient is zero."

Kreyszig-7.3-5 (last edited 2010-12-17 05:02:09 by 172)