How to extract length along an angle that intercepts an ellipse.
Ältere Kommentare anzeigen
I am working on a problem where I obtain a strain matrix and want to extract the magnitude of that strain along a specified angle. The way I envision it is that the strain matrix represents the vectors corresponding to the major and minor axis of an ellipse and I then want to find the magnitude of a line along my specified angle that intersects that ellipse.

For example above I have a strain matrix that would be defined as
E=[ 1 0;
0 0.5];
This could be represented as the blue ellipse I plotted in the figure. In this scenario my then specified angle is 45˚ (pi/4) represented by the red line. In this scenario the magnitude I am looking for would be:
sqrt(0.45^2+0.45^2)=0.6364
Now I am trying to figure out how to do this via math. I imagine I should be able to simply rotate the ellipse by the negative of my given angle so that the point along the angle I am interested in is now along the x axis and I should be able to simply extract out the x component, as shown graphically:

So in doing this mathematically I figure I rotate the strain matrix as below:
E=[ 1 0;
0 0.5];
rotation=[cos(-pi/4) -sin(-pi/4);sin(-pi/4) cos(-pi/4)];
rotated=rotation*E;
I then end up with:
rotated=[ 0.7071 0.3536;
-0.7071 0.3536];
Which by my earlier definition of an ellipse gives the red rotated ellipse above (one axis point at 0.7071,-0.7071 and one axis at 0.3536,0.3536) which should intersect the X-axis at my desired point of x=0.6364.
So how do I extract out this value from the matrix:
rotated=[ 0.7071 0.3536;
-0.7071 0.3536];
Is there a simpler or easier way to accomplish this same task? Thank you!
3 Kommentare
James Tursa
am 3 Apr. 2015
So you are starting with a 2x2 matrix, where the columns represent the endpoints of the principal axes of an ellipse. And you are given an arbitrary angle (e.g., from the x-axis). And you want the coordinates of the point where a line at that angle intersects the ellipse?
JL
am 3 Apr. 2015
JL
am 3 Apr. 2015
Akzeptierte Antwort
Weitere Antworten (1)
James Tursa
am 3 Apr. 2015
Bearbeitet: James Tursa
am 3 Apr. 2015
To get started, e.g.,
>> % Original data
>> E = [1 0; 0 0.5]
E =
1.0000 0
0 0.5000
>> rot_angle = -pi/4
rot_angle =
-0.7854
>> % Create rotation
>> rotation = [cos(rot_angle) -sin(rot_angle); sin(rot_angle) cos(rot_angle)]
rotation =
0.7071 0.7071
-0.7071 0.7071
>> rotated = rotation*E
rotated =
0.7071 0.3536
-0.7071 0.3536
Now the recovery part:
>> % Recover principal axes lengths
>> v = sqrt(sum(rotated.*rotated))
v =
1.0000 0.5000
>> % Recover principal axes rotation angle
>> rot_calculated = atan2(rotated(2,1),rotated(1,1))
rot_calculated =
-0.7854
Now assume you have the following:
ang = angle from x-axis for the "line"
Then you have two equations to solve for x and y:
(x/a)^2 + (y/b)^2 = 1 % a and b are the elements of v above
and
x * tan(ang-rot_calculated) = y
So solve these two equations for x and y, then re-create the rotation matrix (from ang_calculated) and rotate x and y to give you the point coordinates.
If abs(tan(ang-rot_calculated)) > 1, then maybe work with the following equation instead:
x = cot(ang-rot_calculated) * y
I.e., plug either the x expression or the y expression into the ellipse equation and solve for the other.
5 Kommentare
JL
am 3 Apr. 2015
James Tursa
am 3 Apr. 2015
Bearbeitet: James Tursa
am 3 Apr. 2015
That's why I posted a problem summary and asked for confirmation first. If that problem summary is not accurate, then please re-state your problem so we can address the real issue. Once you recover the principal axes lengths and the rotation angle, I think you have everything you need to get your answer. We simply need confirmation of what exactly this "line angle" is, I guess.
Are you saying that you actually know E up front, and all of this rotation business is something inserted by you as an attempt to solve the problem? I.e., do you just have E and a line angle and simply want to know where this line angle intersects the ellipse? If so, then just use those last two equations above.
JL
am 3 Apr. 2015
James Tursa
am 3 Apr. 2015
So you have "rotated", and you are simply trying to find the intersection of that "rotated" ellipse and the x-axis?
JL
am 3 Apr. 2015
Kategorien
Mehr zu Interpolation finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!