Message Boards Message Boards


Calculate the angle of an ellipse from it's matrix representation?

Posted 10 months ago
5 Replies
5 Total Likes


I have generated a bunch of points then fed them to :

ellipse =BoundingRegion[points, "FastEllipse"].

The output is :

Ellipsoid[{0, 0}, {{0.0698865, 0.0545128}, {0.0545128, 0.0698865}}].

My question is: using the weighted matrix in the output – {{0.0698865, 0.0545128}, {0.0545128, 0.0698865}} – how can I calculate the angle of the ellipse ?

Many Thanks, Andrew

5 Replies

Are these the angles you're after?:

ArcTan @@@ Eigenvectors@{{0.0698865, 0.0545128}, {0.0545128, 0.0698865}}
{0.785398, 2.35619}
{45., 135.}
Posted 10 months ago

Your answer goes in the right direction I think. But for example I am not sure how to interpret a negative angle such as in:

Out[97]= {1.90163,-2.81076}
Out[98]= {108.955,-161.045} <<< this negative angle.

In any case thank you for your answer !

Posted 10 months ago

Hello Michael, This is definitely a step forward for me ! However I am not sure how to interpret negative results. For example:

ArcTan @@@ Eigenvectors@{{0.0749932, -0.128978}, {-0.128978, 0.406223}}
Out[93]= {1.90163, -2.81076}
Out[94]= {108.955, -161.045} <<<<<<<<<<<<<<< here 

Many thanks ! Andrew

The range on ArcTan[x,y] per the docs is -Pi to Pi. Negative angles represent angles measured clockwise from the positive x axis, as in standard trigonometry. They will lie in quadrants III and IV if they are between -Pi and 0. You can add Pi or a 180 degrees to them and get a collinear angle that corresponds to the angle of the eigenvector -v, if v is the vector returned by Eigenvectors[] corresponding to the negative angle. (Any nonzero multiple of an eigenvector is also an eigenvector.)

Posted 10 months ago

Hello Michael, My last post was more a comment than a question but thanks for your reply. I am active in digital photography and am currently working on color distance questions where ellipses play an important role. Ellipses represent areas of colors inside of which all colors may be considered as equivalent. Being able to know or double-check the size and orientation of the ellipse is fundamental. So your help above is greatly appreciated ! Best Regards, Andrew PS I think I should brush up on Eigenvectors !

Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
or Discard

Group Abstract Group Abstract