theta= var('theta')

A = matrix([[1,0,0],[0,cos(theta), - sin(theta)],[0, sin(theta), cos(theta)]])

print A


A.characteristic_polynomial()

evals = A.eigenvalues()
print 'eigenvalues are'
print evals



a = vector([-sin(theta), cos(theta)])
b = vector([-sin(theta), +cos(theta)])

a*b

# one of the eigenvalues is real, two are complex conjugate pairs and their absolute = 1 => orthogonal matrix

SageDays/Kreyszig-7.3-4 (last edited 2010-08-11 12:55:24 by bhanukiran)