Documentation Center

  • Trial Software
  • Product Updates

Plane Rotations

This example shows how to do plane rotations using Symbolic Math Toolbox™.

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 = simplify(ans)
 
ans =
 
[  cos(2*t), sin(2*t)]
[ -sin(2*t), cos(2*t)]
 

G is an orthogonal matrix; its transpose is its inverse.

G.'*G

ans = simplify(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) - sin(t)*i
 cos(t) + sin(t)*i
 

Apply the simplification rules.

e = simplify(e)
 
e =
 
 cos(t) - sin(t)*i
 cos(t) + sin(t)*i
 
Was this topic helpful?