Create a symbolic variable named t.
t = sym('t')
t = t
Create a 2-by-2 matrix representing a plane rotation through an angle t.
G = [ cos(t) sin(t); -sin(t) cos(t)]
G = [ cos(t), sin(t)] [ -sin(t), cos(t)]
Compute the matrix product of G with itself.
G*G
ans = [ cos(t)^2-sin(t)^2, 2*cos(t)*sin(t)] [ -2*cos(t)*sin(t), cos(t)^2-sin(t)^2]
This should represent a rotation through an angle of 2*t. Simplification using trigonometric identities is necessary.
ans = simple(ans)
ans = [ cos(2*t), sin(2*t)] [ -sin(2*t), cos(2*t)]
G is an orthogonal matrix; its tranpose is its inverse.
G.'*G ans = simple(ans)
ans = [ cos(t)^2+sin(t)^2, 0] [ 0, cos(t)^2+sin(t)^2] ans = [ 1, 0] [ 0, 1]
What are the eigenvalues of G?
e = eig(G)
e = cos(t)+(-1+cos(t)^2)^(1/2) cos(t)-(-1+cos(t)^2)^(1/2)
Repeatedly apply the simplification rules.
e, for k = 1:4, e = simple(e), end
e = cos(t)+(-1+cos(t)^2)^(1/2) cos(t)-(-1+cos(t)^2)^(1/2) e = cos(t)+(-sin(t)^2)^(1/2) cos(t)-(-sin(t)^2)^(1/2) e = cos(t)+i*sin(t) cos(t)-i*sin(t) e = exp(i*t) 1/exp(i*t) e = exp(i*t) exp(-i*t)