How to define an ellipse by the eigendecomposition of its transformation matrix?

9 views (last 30 days)
I'm trying to establish the correct setup for defining an ellipse as a 'stretch' of a circle and a rotation of the result. For simplicity assume the centres of the circle and therefore the ellipse to be so that the equation of the ellipse is
Now let the eigenvalues of be and so that the 'stretch' matrix is
and let the rotation, counter-clockwise, of an angle θ from the x-axis be achieved by the transformation
Since , is an admissible matrix of eigenvectors and it should be possible to express as the product of its eigendecomposition by
However, when I perform the reverse operation in practice, clearly something in the above is not correct, but I'm not sure what it is. The code snippet below illustrates the issue for and , . What is it I'm getting wrong?
>> theta = pi/4
theta =
>> R = [cos(theta) sin(theta); -sin(theta) cos(theta)]
R =
0.70711 0.70711
-0.70711 0.70711
>> S = [1 0; 0 4]
S =
1 0
0 4
>> A = R*S*R'
A =
2.5 1.5
1.5 2.5
>> [V,D] = eig(A)
V =
-0.70711 0.70711
0.70711 0.70711
D =
1 0
0 4
>> V*D*V'-A
ans =
-4.4409e-16 -4.4409e-16
-4.4409e-16 -4.4409e-16

Sign in to comment.

Accepted Answer

Torsten on 21 Sep 2022
Moved: Walter Roberson on 21 Sep 2022
phi = linspace(0,2*pi,100);
S = [1 0;0 4];
xy = S*[cos(phi);sin(phi)];
theta = pi/4;
Sxy = [cos(theta) -sin(theta);sin(theta) cos(theta)]*xy;
hold on
hold off
  1 Comment
RickyBoy on 21 Sep 2022
Moved: Walter Roberson on 21 Sep 2022
Thank you, most helpful! I can't mark this as an accepted answer because it was submitted as a comment but if you submit it as an answer I will mark it as the accepted one. In any case, I appreciate your engagement.

Sign in to comment.

More Answers (0)




Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!