Gary
Gary

Reputation: 11

Ellipse fit tangentally to a line modifying one axis

A graphic of this problem is here:

http://dl.dropbox.com/u/13390614/Question.jpg

Take an axis aligned ellipse with a fixed minor axis, and stretch the ellipse along its major axis till it becomes tangental to some line segment (A in the graphic).

What are the coordinates of the tangental point (P), or, what would the major axis length be?

I know how to calc the major axis if I have the tangental point, and can calc the point if I have the major axis, but with neither, I'm stumped

I have also solved this when the minor axis is stretched along with the major, maintaining the ratio. The problem is when one axis is fixed.

Any insights would be appreciated, especially via trig.

Gary

Upvotes: 1

Views: 400

Answers (2)

Reid Barton
Reid Barton

Reputation: 15029

The point P has y-coordinate r^2/h, where r is the semi-minor axis of the ellipse (so here r=0.75) and h is the y-coordinate of the point where the extension of your segment meets the y-axis (call this point H).

Why is this? Well, imagine that we know what the correct ellipse and point P are, and now perform the affine transformation (x, y) -> (kx, y) where k is chosen so that the ellipse turns into a circle. This doesn't move H, since H is on the y axis, and it moves P to a point P' with the same y-coordinate so that HP' is the tangent segment from H to the circle of radius r. By similar right triangles, P' (and thus P) has y-coordinate r^2/h.

Of course it might happen that P doesn't lie on the original segment but only its extension to a line, or that the vertical axis is actually the major axis of the resulting ellipse; you might need to check these depending on your application.

Upvotes: 0

Alexey Malistov
Alexey Malistov

Reputation: 27023

Consider

x^2/max^2 + y^2/fix^2 = 1; % ellipse
Ax + By + C = 0;            % segment line

Then

x^2/max^2 + (Ax + C)^2/(B*fix)^2 = 1; // Quadratic equation

Your solution is when discriminant is equal to 0.

   x^2   (1/max^2 + A^2/(B*fix)^2)   
+  x      2 AC/(B*fix)^2
+        C^2/(B*fix)^2 - 1  
= 0

a = (1/max^2 + A^2/(B*fix)^2);
b = 2 AC/(B*fix)^2;
c = C^2/(B*fix)^2 - 1.

b^2 = 4ac   ==>   a = b^2/c    ==>
a = 4(AC)^2/(B*fix)^4 / ( C^2/(B*fix)^2 - 1 )
1/max^2 = 4(AC)^2/(B*fix)^4 / ( C^2/(B*fix)^2 - 1 ) - A^2/(B*fix)^2);

Upvotes: 2

Related Questions